1 2 FILE="filename.txt" 3 FIND="old text" 4 REPLACE="new text" 5 find . -name $FILE -print0 | xargs -0p perl -pi -w -e "s/$FIND/$REPLACE/g;"
Remove the p flag if confirmation is not necessary.
12970 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
1 2 FILE="filename.txt" 3 FIND="old text" 4 REPLACE="new text" 5 find . -name $FILE -print0 | xargs -0p perl -pi -w -e "s/$FIND/$REPLACE/g;"
You need to create an account or log in to post comments to this site.