Last active
December 24, 2015 10:39
-
-
Save viniciusban/6785368 to your computer and use it in GitHub Desktop.
Makes a recursive sed in place substitution.
This file contains 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
#!/usr/bin/env bash | |
# Makes sed a recursive in place substitution and | |
# create backup of original files with .bkp extension. | |
old=$1 | |
new=$2 | |
sed -i.bkp "s/${old}/${new}/g" $(grep -ril "${old}" .) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment