https://github.com/ggreer/the_silver_searcher * ag is faster than ack * ag searches all files by default (but still ignores gitignored files). This removes the need for ack's `--type-add=` options. * The command is 33% shorter than ack!
12 lines
197 B
Bash
Executable file
12 lines
197 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 $find_this $* | xargs sed -i '' "s/$find_this/$replace_with/g"
|