Wednesday, May 26, 2010

String replacement commands

Replace:
Syntax:
replace from to - filename

eg:cat test1
hai I am fine

replace hai hi -- test1

==================================

We can also use sed command for replacing the string

====================
Syntax:
sed 's/oldstring/newstring/g' filename

eg: sed 's/hai/hi/g' test1

No comments:

Post a Comment