sed command meaning


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sed command meaning
# 1  
Old 04-25-2006
sed command meaning

Thanks guys for helping me out

Last edited by chris1234; 04-25-2006 at 04:50 PM..
# 2  
Old 04-25-2006
Quote:
Originally Posted by chris1234
sed -e "s/^http:\/\///" -e "s/^\/\{2,5\}//" -e "s/^\/$//" |

what i can think of it this command means substitue where you find a file beginning with http: followed by " and to save all the text on line until double quote is found .
-e "s/^http:\/\///"
https://www.unix.com becomes www.unix.com i.e. get rid of http://

-e "s/^\/\{2,5\}//"
Any line which starts with the one of the following
//
///
////
/////

will be removed.

-e "s/^\/$//"
Any line which starts and ends with a / will be removed. i.e. the line contains only a /

Quote:
Originally Posted by chris1234
here is another one.

sed "s/.*:.*//" |
i dont know the rest and please clearify me if i am wrong trying to learn this scripting and vi editor. any help would be great.
Thanks
Any statement containg a : (colon) and text on either side of : (colon) will be removed. The | is a pipe. There might be some command after that.
# 3  
Old 04-25-2006
Thanks a bunch vino
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed and awk giving error ./sample.sh: line 13: sed: command not found

Hi, I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :- ./sample.sh: line... (12 Replies)
Discussion started by: satishmallidi
12 Replies

2. UNIX for Dummies Questions & Answers

Compile command meaning?

cc -Wall -c ctest1.c ctest2.c whats meaning of -(hyphen before c and wall) (1 Reply)
Discussion started by: mahor1989
1 Replies

3. UNIX for Dummies Questions & Answers

Meaning of command ls -la

Hello everyone, I just began studying solaris 10. I have tried searching for the meaning of this command (ls -la ). Can anyone please explain to me what the command ls -la does? example ls -la /etc Thank you (5 Replies)
Discussion started by: cjashu
5 Replies

4. UNIX for Dummies Questions & Answers

meaning of swap -s command

Hi, Please explain about the command and its output swap -s in a very detailed manner (3 Replies)
Discussion started by: Ajoy
3 Replies

5. Shell Programming and Scripting

Meaning of sed -e 's;\.;0;g'

Hi there, I was searching for some code in sed & I got REQUIRED_VERSION=`echo $REQUIRED_VERSION | sed -e 's;\.;0;g'` Can anybody tells me what exactly is happening there, specially "s;\.;0;g" this part? (2 Replies)
Discussion started by: jw_amp
2 Replies

6. UNIX for Dummies Questions & Answers

passwd command what is the meaning

Hello to everybody i have question i do the passwd -s -a commando and what to knos what is the meaning of the second row. PS NL LK to the side is the date of expiraton and then a 7 a 90 what is the meaning of all that? tHANK YOU FOR YOUR TIME. (1 Reply)
Discussion started by: enkei17
1 Replies

7. Shell Programming and Scripting

Loop with sed command to replace line with sed command in it

Okay, title is kind of confusion, but basically, I have a lot of scripts on a server that I need to replace a ps command, however, the new ps command I'm trying to replace the current one with pipes to sed at one point. So now I am attempting to create another script that replaces that line. ... (1 Reply)
Discussion started by: cbo0485
1 Replies

8. AIX

What's meaning of "POWER" in diag command.?

I ran 'diag' command to verify disk follow the below steps. DIAG------?task selection-------ssa service aid-----Link verification I found that there are 3 types of status. (Good, Failed and Power). scp2: pdisk23 D69E584F 0 16 Power scp2: pdisk19 D657E7A9 1 15 Power scp2: pdisk28... (1 Reply)
Discussion started by: pattarapongn
1 Replies

9. Shell Programming and Scripting

Command meaning

I know tr stands for table if i am not wrong but what does this whole command means can anyone give an idea ? | tr ' ' '\n' | sed -e "s/.*=\"\(.*\)\".*/\1/g (2 Replies)
Discussion started by: chris1234
2 Replies

10. UNIX for Advanced & Expert Users

Command meaning.

what does it mean set linesize 200; set linesize 2000; i am spooling the data into a file .When i give 200 the size of file is 72MB. When i give 2000 its 720 MB.How do i know if i am getting all the data.......? (2 Replies)
Discussion started by: praveen.pinto
2 Replies
Login or Register to Ask a Question