【发布时间】:2014-08-22 18:33:21
【问题描述】:
我正在尝试用其 https 版本替换许多 html 页面上存在的特定链接。我试过了:
grep -rl "http://server.iad.liveperson.net/hc/88956865/" ./ | xargs sed -i "s/http:\/\/server.iad.liveperson.net\/hc\/88956865\//https:\/\/server.iad.liveperson.net\/hc\/88956865\//g"
当我这样做时,即使是sudo,我也会得到
sed: couldn't open temporary file ./customers/sedTR3AMu: Permission denied
customers 只是./ 中的第一个目录。所以,它挂在我认为的第一个文件上,但不确定除此之外还有什么问题。
感谢任何帮助!
【问题讨论】:
-
对
sed使用不同的分隔符。sed 's_http://server.iad.liveperson.net/hc/88956865/_https://server.iad.liveperson.net/hc/88956865/_g因为sed混淆了分隔符的开始和结束位置。