我正在尝试运行一个 for 循环,它将替换作为列表传递的文件中的字符串。
例子:
Filename1
Filename2
File name3
File name4
我目前的代码是:
for i in `grep -Rl 'OLD' *`; do
> perl -pe 's/OLD/NEW/g' -pi "$i"
> done
Can't open File: No such file or directory.
Can't open name3: No such file or directory.
Can't open File: No such file or directory.
Can't open name3: No such file or directory.
Can't open File: No such file or directory.
Can't open name4: No such file or directory.
谢谢!