Question

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

Was it helpful?

Solution

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"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top