Skip to content

Instantly share code, notes, and snippets.

@chefe
Created January 27, 2014 15:52
Show Gist options
  • Save chefe/0d5b5ab944e197784923 to your computer and use it in GitHub Desktop.
Save chefe/0d5b5ab944e197784923 to your computer and use it in GitHub Desktop.
Do something in a shell script based on the os type
if [ "$(uname)" == "Darwin" ]; then
# Do something under Mac OS X platform
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# Do something under Linux platform
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
# Do something under Windows NT platform
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment