Last active
December 19, 2015 21:19
-
-
Save dtuite/6019512 to your computer and use it in GitHub Desktop.
Example of using sed to find and replace recursively in a hierarchy of directories.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://stackoverflow.com/a/1583282/574190 | |
find app/views -type f -print0 -name "*.erb" | xargs -0 sed -i '' 's/Et\.trac/mixpanel\.trac/g' | |
# Not sure why the following isn't equivilent. | |
sed =i '' 's/Et\.trac/mixpanel\.trac/g' app/views/**/*.html.erb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment