|
发表于 2006-8-30 21:27:51
|
显示全部楼层
嗯嗯,发现这个问题了,是我写错了,谢谢提醒。
以下脚本经过测试,没问题的:
#!/bin/sh
#filename: replace
#Usage: ./replace file1 ... fileN
#Before use the script file, please do
# $ chmod +x replace
#first.
if [ $# -eq 0 ] ; then
echo "Usage: ./replace file1 .. fileN";
exit 1;
fi
for i in $@
do
sed -e 's/account1/account2/g' $i > $i.$$;
mv $i.$$ $i;
done
#end sed script |
|