Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sed Help 1

Status
Not open for further replies.

inunix

Technical User
Jul 30, 2002
53
US
This is my requirement.
I need to replace all files with specific patterns.
the list of patterns will be specified in a file like this
(string to replace and string to replace with)

<p>Global</p> <p>local</p>
<p>fail</p> <p>success</p>

I've used a shell script to do this. Read a file,
and using sed I've tried to replace. But I'm getting an error like
sed: command garbled: s/&quot;<p>Global</p>&quot;/&quot;<p>local</p>&quot;/g

my shell is
for i in `ls *`
do
while read xx yy
do
sed 's/&quot;'$xx'&quot;/&quot;'$yy'&quot;/g $i >tmp/$i
done < patternfile

Please help.
 
sed &quot;s:${xx}:${yy}:g&quot; $i >tmp/$i

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Thanks vgersh99, It's working great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top