开发者

Regex with wget?

I'm using wget to download some useful website:

wget -k -m -r -q -t 1 http://www.w开发者_StackOverflow社区eb.com/

but I want replace some bad words with my own choice (like Yahoo pipes regex)


If you want to regexp out words from within the page you are fetching with wget, you should pipe the output through sed.

For example:

wget -k -m -r -q -t 1 -O - http://www.web.com/ | sed 's/cat/dog/g' > output.html

Use the -O - flag to write the output to stdout, and the -q flag to make wget run in quiet mode.

Haven't got a shell atm to check my syntax but that should set you on the right path!


You can use sed -i.

find www.web.com -type f -exec sed -i 's/word1\|word2\|word3//ig' {} +

word1, word2, word3, etc. are the words to delete.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜