Computing.Net > Forums > Unix > shell script/sed/awk

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

shell script/sed/awk

Reply to Message Icon

Name: mehul
Date: May 14, 2003 at 13:01:40 Pacific
OS: sun 5.8
CPU/Ram: sun
Comment:

Hi gurus ,

I need a help .....i have a file
#CORBA TESTCASES ARE REMOVED FROM HERE. THEY ARE RUN IN WINDOWS NOW...
#CORBA TESTCASES
#xrun /AutoCtm/testcases/try saf
#xrun /AutoCtm/testcases/corba/corba_equip_prov http://wwwin-tims-omu.cisco.com/include/r.cfm?id=7
#xrun /AutoCtm/testcases/corba/corba_circuit_prov http://172.28.170.120/circuit_result.html
#
#############
# Scripts to be executed goes here. Script should preceed with "!"
!TL1
script=/AutoCtm/Tl1/Scripts/Bin/tl1-start
resultXML=/AutoCtm/Tl1/xml/results.xml
resultURL=http://wwwin-tims-omu/include/r.cfm?id=155
!DBRESTORE
script=/AutoCtm/restorescript.sh
resultXML=/AutoCtm/Tl1/xml/results.xml
resultURL=http://wwwin-tims-omu/include/r.cfm?id=155
#


i have to grep for the line "/AutoCtm/Tl1/Scripts/Bin/tl1-start" in the file and replace it with another string + i want to add to more parameters to it

final string should be
script=/xyz/abc/ddd/eee arg1 arg2

how do i search in a file for this particualr string and replace it with sed i was able to replace a single word but how do i search it for strings with "/"

your help will be appreciated

Thx a lot in advance

Mehul



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: May 14, 2003 at 14:22:33 Pacific
Reply:

Hi:

"/" is a special meta character to the shell. You need to escape it in your sed script:

\/

Regards,

nails


0

Response Number 2
Name: WilliamRobertson
Date: May 15, 2003 at 07:20:33 Pacific
Reply:

Alternatively use a different delimiter for the sed command, e.g:

sed 's#/#?#g' somefile.dat


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: shell script/sed/awk

use variable of shell script in awk www.computing.net/answers/unix/use-variable-of-shell-script-in-awk/4570.html

Using hex-code in shell script www.computing.net/answers/unix/using-hexcode-in-shell-script/4227.html

Shell Script & Awk www.computing.net/answers/unix/shell-script-amp-awk/4594.html