Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 13 lines (12 sloc) 436 Bytes
# Replace word $1 with word $2 recursively in $3
# $ replace foo bar templates/
# This may fail with "bin/perl: Argument list too long" if the number of files
# found by `find` is too large. Make $3 more specific and run the script
# multiple times to get around this.
if [[ -n "$1" && -n "$2" && -n "$3" ]]
perl -e "s/$1/$2/g;" -pi $(find $3 -type f)
echo "usage: replace [to_replace] [replacement] [directory]"
You can’t perform that action at this time.