scatterd-dotfiles/bin/replace
2015-07-28 21:20:01 -04:00

12 lines
213 B
Bash
Executable file

#!/bin/sh
#
# Find and replace by a given list of files.
#
# replace foo bar **/*.rb
find_this="$1"
shift
replace_with="$1"
shift
ag -l --nocolor "$find_this" $* | xargs sed -i '' "s/$find_this/$replace_with/g"