Register
It is currently Wed Apr 23, 2014 1:37 pm

good [sed] info


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Mon May 16, 2005 8:32 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 657
Location: Des Moines, Iowa
Originally posted by Mekanik
sed on sf.net

sed - one liners

here's some good info on SED and some nice one-liners....

-mekanik


Top
 Profile WWW  
 PostPosted: Mon May 16, 2005 8:33 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 657
Location: Des Moines, Iowa
Originally posted by Geeshock
sed came in handy fot me a cupple of times, like when I had to replace an ip in like 80 files :) It saved me much time


Top
 Profile WWW  
 PostPosted: Mon May 16, 2005 8:34 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 657
Location: Des Moines, Iowa
Originally posted by Mekanik

[quote=geeshock]sed came in handy fot me a cupple of times, like when I had to replace an ip in like 80 files :) It saved me much time[/quote]

you can also use a cool perl one-liner to do that also.

this will make a backup of <filename> to <filename~> and then replace the first instance found on each line:
Code:
perl -i~ -pe 's!search_string!replace_string!' mss.sh


this will make a backup of <filename> to <filename~> and then replace all instances found on each line:
Code:
perl -i~ -pe 's!search_string!replace_string!g' mss.sh


-mekanik


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP