Created
February 7, 2012 05:45
-
-
Save onjiro/1757492 to your computer and use it in GitHub Desktop.
grep して 置換するよー。sed -i が使えればこんな面倒なことはいらないッ・・・!
This file contains hidden or 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
# 次の置換と同じ。 | |
# grep -lre h1 検索対象ディレクトリ | xargs sed -i 's/h1/h2/g' | |
grep -lre 'h1' 検索対象ディレクトリ | xargs -n 1 -i sh "cp {} tmp; sed -e 's/h1/h2/g' ./tmp > {}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment