This is a discussion on what is the use of sed command within the Shell scripting forums, part of the Development/Scripting category; hi, what is the use of sed command and i had seen one command like sed ' s/ \([0-9]\)/,\1/ s/\([0-9]\) ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
hi,
what is the use of sed command and i had seen one command like sed ' s/ \([0-9]\)/,\1/ s/\([0-9]\) /\1,/ ' test | sort -k1,3 here i am getting bit confusion with frontslash and backslah why they but / and \ again and again. plz explain to me . i am new learner to shell script |
| Sponsored Links | ||
|
|
|
|||
|
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 |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|