LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sed command (http://www.linuxquestions.org/questions/linux-newbie-8/sed-command-4175420585/)

figure20012 08-06-2012 01:59 AM

sed command
 
sed 's#.*://##' | sed 's:/.*::' | sed 's:^.*.([^.]*).[^.]*:1:' | uniq -c

Could anyone please tell me what this command does?

grail 08-06-2012 02:19 AM

Well how about you tell us where you are stuck? Remembering that sed allows any character to be used when doing a replace, the default being s///

The rest are regular expressions

etech3 08-06-2012 03:23 AM

figure20012

Did you run it? :D

grail
12 hours in front of me! G'day :hattip:

figure20012 08-06-2012 05:20 AM

Quote:

Originally Posted by etech3 (Post 4747024)
figure20012

Did you run it? :D

grail
12 hours in front of me! G'day :hattip:

thats why i am asking :P
i dont know the effet of it on my linux box
please could you explain?

grail 08-06-2012 09:32 AM

Well as it stands the affect on your linux box will be nil as there is no input.

And here are 3 search results for "regular expressions"

http://www.zytrax.com/tech/web/regex.htm
http://www.regular-expressions.info/
http://www.regexlib.com/?AspxAutoDetectCookieSupport=1

sycamorex 08-06-2012 09:49 AM

Quote:

Originally Posted by grail (Post 4747228)
Well as it stands the affect on your linux box will be nil as there is no input.

On top of that, there's no -i flag in sed so even if there was some input, the results would only get displayed in a terminal window.

chrism01 08-06-2012 07:09 PM

See also http://www.grymoire.com/Unix/Sed.html#uh-0

As per sycamorex & you would also have to feed it some data to work on

pixellany 08-06-2012 07:25 PM

Quote:

Originally Posted by figure20012 (Post 4747080)
thats why i am asking :P
i dont know the effet of it on my linux box
please could you explain?

There are several possible answers, but they are all questions:
What is it **supposed** to do?
What happens when you run it?
Where did you get it?
etc.

My point---in case you were wondering---it that we need to understand the context of your question.


All times are GMT -5. The time now is 05:58 AM.