Perl Search and Replace One-liner with xargs -0


/ Published in: Bash
Save to your folder(s)

\Q...\E perl quoting means no ugly escaping in the regex. find's -print0 with xargs -0 is the secret to handling files with spaces in their names.


Copy this code and paste it in your HTML
  1. find . -name "*.html" -print0 | xargs -0 perl -p -i -e 's|\Qhttp://66.36.242.244/~olxhxlwq/\E|http://www.johnclarkprose.com/|g'

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.