View Single Post

  #3 (permalink)  
Old 12-06-2007, 10:18 PM
jarhed jarhed is offline
Junior Member
User
 
Join Date: Dec 2007
My distro: Ubuntu - Gutsy Gibbon
Posts: 1
Rep Power: 0
jarhed is on a distinguished road
Smile The use of sed...

I just just wanted to share a perfect example of using the sed command...

I am a multimedia and web-designer and often have to change multiple items throughout websites. Long story short, one of my clients needed their e-mail address's changed throughout their ENTIRE site. The site is fairly large, with roughly 50 pages or so (greenhouse with a page for all varieties of plant.

By using the sed command, I was able to search the ENTIRE site and replace the old e-mail address's with the new one. If I were to have to opened each .html file in nano I would have shot myself...This turned a lengthy job into a 2 min project.

FYI.
If you are planning on using any of the illegal characters in the sed command, make sure to use the '\' prior to the character itself.

ie. #: sed 's/info@youroldaddress\.com/info@yournewservice\.st\.com/g' .html

Hope this sheds some light on ONE of it's MANY, MANY uses...and hopefully if your in the same situation, helps you out!

Enjoy,
Jimmi
jarhed
Reply With Quote