Вопрос

Lets say I hit foo.html with find, i would like to pipe the contents back into foo.html

find . -iregex '.*\(html\|htm\)' -printf '%P\0' | \
xargs -0 sed -Ee "s:(http|https)\://(www.|)${domain}[?/]::g" \
> # to what? {\} ???

Right now it does not know what or where its

Это было полезно?

Решение

Pass the -i flag to sed, then it will modify the input file in place.

find . -iregex '.*html?' -printf '%P\0' | xargs -0 sed -i -Ee "s:(http|https)\://(www.|)${domain}[?/]::g"
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top