LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-06-2012, 01:59 AM   #1
figure20012
Member
 
Registered: Apr 2012
Posts: 75

Rep: Reputation: Disabled
sed command


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

Could anyone please tell me what this command does?
 
Old 08-06-2012, 02:19 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,983

Rep: Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182
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
 
1 members found this post helpful.
Old 08-06-2012, 03:23 AM   #3
etech3
Senior Member
 
Registered: Jul 2009
Location: Virginia
Distribution: Debian Stable Testing Sid Slackware CentOS
Posts: 1,055
Blog Entries: 2

Rep: Reputation: 45
figure20012

Did you run it?

grail
12 hours in front of me! G'day
 
1 members found this post helpful.
Old 08-06-2012, 05:20 AM   #4
figure20012
Member
 
Registered: Apr 2012
Posts: 75

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by etech3 View Post
figure20012

Did you run it?

grail
12 hours in front of me! G'day
thats why i am asking :P
i dont know the effet of it on my linux box
please could you explain?
 
Old 08-06-2012, 09:32 AM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,983

Rep: Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182Reputation: 3182
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
 
Old 08-06-2012, 09:49 AM   #6
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
Quote:
Originally Posted by grail View Post
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.
 
Old 08-06-2012, 07:09 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,308

Rep: Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744
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
 
Old 08-06-2012, 07:25 PM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by figure20012 View Post
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.
 
  


Reply

Tags
sed, sed bash


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] sed gives :sed: -e expression #1, char 1: unknown command: `'' samasat Linux - Newbie 10 06-09-2012 05:31 PM
[SOLVED] sed help to run sed command against multiple different file names bkone Programming 2 04-16-2012 12:27 PM
Sed command - command garbled errror gauavmahesh Linux - Newbie 3 03-30-2012 10:04 PM
Modifying text file with "one command line" SED command... daleo Linux - Newbie 3 01-13-2012 05:32 AM
sed command ancys Programming 2 08-05-2006 10:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration