Thursday, February 4, 2010

sed: find and replace in place

To replace in place means to change the original file with the substitutions. (Contrary to the default behavior of sed which is to print to standard out.)

It's simple:

sed -i 's/sad/happy/g' filetochange.txt

No comments: