EnderUNIX Team.

EnderUNIX tips

Mail to My Friend , Home Page

[ File Processing ]

"Command-line string replacing in a file" - Baris Simsek - (2006-09-29 05:59:00)   [12082]

If you want to replace a string with another one in a file you can use sed.

sed -i .bak s/int/char/g file.c

This will replace 'int' to 'char' and gets backup of original file as file.c.bak

If you want no backup:
sed -i '' s/int/char/g file.c

Mail to My Friend , Home Page