Add quotes for variables in replace

This commit is contained in:
Timothy Fenney 2015-07-28 21:20:01 -04:00
parent f908cc9b8f
commit 74fd8a362e

View file

@ -4,9 +4,9 @@
# #
# replace foo bar **/*.rb # replace foo bar **/*.rb
find_this=$1 find_this="$1"
shift shift
replace_with=$1 replace_with="$1"
shift shift
ag -l --nocolor $find_this $* | xargs sed -i '' "s/$find_this/$replace_with/g" ag -l --nocolor "$find_this" $* | xargs sed -i '' "s/$find_this/$replace_with/g"