Created
April 21, 2011 20:38
-
-
Save alunny/935415 to your computer and use it in GitHub Desktop.
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
# sed in place, for OS X (Darwin) and Linux | |
# user-agent detection - probably not the best way | |
DASHI='' | |
unamestr=`uname` | |
if [[ "$unamestr" == 'Linux' ]]; then | |
DASHI="-i" | |
elif [[ "$unamestr" == 'Darwin' ]]; then | |
DASHI='-i ""' | |
fi | |
echo hello > demo | |
sed $DASHI 's/l/b/g' demo #hebbo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment