xz00xz
想用vi批量替换多文件中字串出错,求教
报错,不能替换,求教!
$ ls *.txt|xargs -t -I{} vi -e -s -c ":%s/3/fuck/g" -c ":wq!" {}
vi -e -s -c :%s/3/fuck/g -c :wq! 0.txt
ex: 0602-000 is not a recognized flag.
vi -e -s -c :%s/3/fuck/g -c :wq! 1.txt
ex: 0602-000 is not a recognized flag.
vi -e -s -c :%s/3/fuck/g -c :wq! 2.txt
ex: 0602-000 is not a recognized flag.
vi -e -s -c :%s/3/fuck/g -c :wq! 3.txt
ex: 0602-000 is not a recognized flag.
vi -e -s -c :%s/3/fuck/g -c :wq! rananim_2km_latitude.txt
ex: 0602-000 is not a recognized flag.
$ ls *.txt|xargs -t -I{} vi -e -s -c '":%s/3/fuck/g"' -c '":wq!"' {}
vi -e -s -c ":%s/3/fuck/g" -c ":wq!" 0.txt
ex: 0602-000 is not a recognized flag.
vi -e -s -c ":%s/3/fuck/g" -c ":wq!" 1.txt
ex: 0602-000 is not a recognized flag.
vi -e -s -c ":%s/3/fuck/g" -c ":wq!" 2.txt
ex: 0602-000 is not a recognized flag.
vi -e -s -c ":%s/3/fuck/g" -c ":wq!" 3.txt
ex: 0602-000 is not a recognized flag.
vi -e -s -c ":%s/3/fuck/g" -c ":wq!" rananim_2km_latitude.txt
ex: 0602-000 is not a recognized flag.
但是单个执行
vi -e -s -c ":%s/3/fuck/g" -c ":wq!" 0.txt
是可以的。。
[[i] 本帖最后由 xz00xz 于 2008-7-1 15:46 编辑 [/i]]