Sed Xargs是否返回到同一个文件中?
假设我用Sed Xargs是否返回到同一个文件中?,sed,xargs,Sed,Xargs,假设我用find点击foo.html,我想通过管道将内容返回到foo.html find . -iregex '.*\(html\|htm\)' -printf '%P\0' | \ xargs -0 sed -Ee "s:(http|https)\://(www.|)${domain}[?/]::g" \ > # to what? {\} ??? 现在它不知道它的将-i标志传递给sed,然后它将修改输入文件 find . -iregex '.*html?' -printf '%P\0'
find
点击foo.html,我想通过管道将内容返回到foo.html
find . -iregex '.*\(html\|htm\)' -printf '%P\0' | \
xargs -0 sed -Ee "s:(http|https)\://(www.|)${domain}[?/]::g" \
> # to what? {\} ???
现在它不知道它的将
-i
标志传递给sed
,然后它将修改输入文件
find . -iregex '.*html?' -printf '%P\0' | xargs -0 sed -i -Ee "s:(http|https)\://(www.|)${domain}[?/]::g"
为什么
*html?
,顺便说一句,你说得对,我忘在原地了,全脑放屁;)加1并等待接受。简化regexp-它应该匹配以htm
结尾的任何内容,可选地后跟l
-i
需要一个关于BSD(即OSX)的参数,必须显式传递'
,才能不保留备份。