Created
February 14, 2009 16:42
-
-
Save daqing/64412 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# recursively searching current directory for "foo" in PHP files and replace it with "bar" | |
for i in `find . -depth -name "*.php" -exec grep -Hni "foo" | awk -F: '{print $1}'`; do | |
if [ -f "$i" ]; then | |
sed -i ".old" -e "s/foo/bar/g' "$i" | |
fi | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment