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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sed does not work properly

Status
Not open for further replies.

czins

Technical User
Jan 14, 2002
37
CH
Hello AIXperts,

I would like to change a pattern in a binary file with the following expression:

cat file | sed "s/c34/s2/" > test

this changes only about half of the occurences of the string c34.

Any ideas ?

Best regards
Stefan
 
I'd guess you are having multiple instances on a line, and you are only transforming the first one. You need the global clause:

cat file | sed "s/c34/s2/g" > test

hth
Mark
 
Hello Mark,

this is the solution !

Thank you very much.

Regards
Stefan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top