Skip to content

Instantly share code, notes, and snippets.

@miend
Created November 4, 2011 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miend/1339797 to your computer and use it in GitHub Desktop.
Save miend/1339797 to your computer and use it in GitHub Desktop.
pure bash find and replace
#!/bin/sh
for file in $(find DIRECTORY -name FILENAME)
do
sed -e "s/KEYWORD/REPLACEMENT/ig" $file > /tmp/tempfile.tmp
mv /tmp/tempfile.tmp $file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment