-
-
Save rajubudde/d251708a79eb88094ca336d1d7b7680d to your computer and use it in GitHub Desktop.
detect os in bash
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
| #!/bin/sh | |
| UNAME=$(uname) | |
| if [ "$UNAME" == "Linux" ] ; then | |
| echo "Linux" | |
| elif [ "$UNAME" == "Darwin" ] ; then | |
| echo "Darwin" | |
| elif [[ "$UNAME" == CYGWIN* || "$UNAME" == MINGW* ]] ; then | |
| echo "Windows" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment