Chinaunix

标题: sed如何将多个文件中的///替换为999? [打印本页]

作者: chino_cu    时间: 2012-03-02 09:54
标题: sed如何将多个文件中的///替换为999?
将多个文件字符串替换是
sed -i "s/old/new/g" `grep old -rl /www`
因为这里要替换的是///这样的特殊字符,

这样

sed -i "s/\/\/\//999/g" `grep /// -rl /www`

结果报错说sed 无法读取grep /// -rl . no such a file or directory.
请问这是怎么回事情?
作者: yinyuemi    时间: 2012-03-02 10:00
回复 1# chino_cu


    sed -i "s,///,999,g" $(grep '///' -rl /www)




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2