Created
October 1, 2014 16:33
-
-
Save kjirou/091db4b8bd4f08496615 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/sh | |
# sed -i は上書き更新オプション | |
find ./path/do/dir -name '*.coffee' | xargs sed -i "s/foo/bar/g" | |
# Mac だと sed -i が使えないので、事前に brew install gnu-sed して gsed を使えるようにする | |
find ./path/do/dir -name '*.coffee' | xargs gsed -i "s/foo/bar/g" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment