2013-01-24 23:52:29 -08:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Find and replace by a given list of files.
|
|
|
|
#
|
|
|
|
# replace foo bar **/*.rb
|
|
|
|
|
2015-07-28 21:20:01 -04:00
|
|
|
find_this="$1"
|
2013-01-24 23:52:29 -08:00
|
|
|
shift
|
2015-07-28 21:20:01 -04:00
|
|
|
replace_with="$1"
|
2013-01-24 23:52:29 -08:00
|
|
|
shift
|
|
|
|
|
2015-07-28 21:20:01 -04:00
|
|
|
ag -l --nocolor "$find_this" $* | xargs sed -i '' "s/$find_this/$replace_with/g"
|