Skip to content

Instantly share code, notes, and snippets.

@bcomnes
Last active March 2, 2020 17:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bcomnes/13711d12237e866de5ca to your computer and use it in GitHub Desktop.
Save bcomnes/13711d12237e866de5ca to your computer and use it in GitHub Desktop.
Run different sh scripts depending on system: http://stackoverflow.com/a/17072017/1287889
#!/bin/bash
if [ "$(uname)" == "Darwin" ]; then
# Do something under Mac OS X platform
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# Do something under GNU/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