Skip to content

Instantly share code, notes, and snippets.

@u1tnk
Created February 17, 2012 07:47
Show Gist options
  • Save u1tnk/1851642 to your computer and use it in GitHub Desktop.
Save u1tnk/1851642 to your computer and use it in GitHub Desktop.
ruby grep replace one-liner
find . -name *.txt -print0 | xargs -0 ruby -i -p -e '$_.gsub! %r{(foo|bar)}, %q{\1baz}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment