Created
February 9, 2010 07:55
-
-
Save thisivan/299008 to your computer and use it in GitHub Desktop.
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 | |
# test your search | |
find . | xargs grep ':precision => 2, :scale => 14' -l | |
# replace text | |
find db/migrate -type f -name "*" -exec sed -i -e "s/:precision => 2, :scale => 14/:precision => 14, :scale => 2/g" "{}" \; | |
# test your results | |
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