Created
January 19, 2010 19:04
-
-
Save thisivan/281173 to your computer and use it in GitHub Desktop.
Replace Text in Files with Sed
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
# Replace text in files using regular expressions: | |
find db/migrate -type f -name "*" -exec sed -i -e "s/:precision => 2, :scale => 14/:precision => 14, :scale => 2/g" "{}" \; | |
# Find replacements made: | |
grep ":precision => 2, :scale => 14" db/migrate/. -R |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment