Computing.Net > Forums > Unix > sed script

sed script

Reply to Message Icon

Original Message
Name: pradeep desh
Date: February 10, 2005 at 21:47:48 Pacific
Subject: sed script
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


Response Number 1
Name: David Perry
Date: February 11, 2005 at 04:31:25 Pacific
Subject: sed script
Reply: (edit)

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







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: sed script

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software