Computing.Net > Forums > Unix > sed script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to get for your free account now!

sed script

Reply to Message Icon

Name: pradeep desh
Date: February 10, 2005 at 21:47:48 Pacific
OS: sun os 5.8
CPU/Ram: 256 MB
Comment:

Hello,
Can I use sed scripts, for ex:

sed -f script filename > newfilename.
where script file is :

diff -e <my version> <production version> > script.

The doubt that i have is in sed, how does the above sed command work..

waiting for reply


Report Offensive Message For Removal

Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: February 11, 2005 at 04:31:25 Pacific
Reply:

The sed script should contain sed commands, not shell commands. You could also pass these to sed without reading from a file with the "-e" flag.

script:
=======
s/this/that/
s/LuxuryYacht/ThroatWobblerMangrove/g
=======

sed -e 's/this/that/' -e 's/LuxuryYacht/ThroatWobblerMangrove/g' infile > outfile


Report Offensive Follow Up For Removal
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: sed script

need help on SED script www.computing.net/answers/unix/need-help-on-sed-script/7487.html

shell script/sed/awk www.computing.net/answers/unix/shell-scriptsedawk/5025.html

Equivalent perl script for sed www.computing.net/answers/unix/equivalent-perl-script-for-sed/5939.html