2009年2月18日 星期三

sed

Want to use sed(1) to edit a file in place? Well, to replace every 'e' with an 'o', in a file name 'foo', you can do:

sed -i.bak s/e/o/g foo

And you'll get a backup of the original in a file name 'foo.bak', but if you want no backup:

sed -i '' s/e/o/g foo

1 則留言:

nIce 提到...

http://www.mgt.ncu.edu.tw/~dino/script/

熱門文章