November 26, 2004

sed edit files in place

sed -i s/aaa/bbb/ file
=
perl -pi -e s/aaa/bbb file

backup as .bak
sed -i.bak s/aaa/bbb/ file

PS.
-i [suffix] is wrong under Linux (space not allowed between -i and [suffix])
sed in Solaris not support this parameter

Posted by pank at November 26, 2004 03:30 PM
Comments

沒想到您也用 -i switch 可以這樣用。學到囉!

Posted by: Baiz at December 6, 2004 03:56 PM
Post a comment













Remember personal info?