Skip to content

Instantly share code, notes, and snippets.

@dnoseda
Created November 18, 2011 05:43
Show Gist options
  • Save dnoseda/1375714 to your computer and use it in GitHub Desktop.
Save dnoseda/1375714 to your computer and use it in GitHub Desktop.
#!/bin/sh
#find $1 -type f -print0 | xargs -0 sed -i 's/$2/$3/g'
echo $1 $2 $3
grep -rl $2 $1 | while read fn; do
echo "replacing in $fn $2 for $3"
sed -i "s/$2/$3/g" $fn
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment