Skip to content

Instantly share code, notes, and snippets.

@kbaribeau
Created February 8, 2011 22:50
Show Gist options
  • Save kbaribeau/817459 to your computer and use it in GitHub Desktop.
Save kbaribeau/817459 to your computer and use it in GitHub Desktop.
the grep garbage is because sed likes to add newlines to the ends of files that don't already end in a newline
find . -type f -name \*.rb -exec grep -qi "foo" {} \; -print |xargs sed -i "" -e "s|foo|bar|g" -e "s|Foo|Bar|g"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment