Created
July 10, 2012 02:04
-
-
Save prabirshrestha/3080525 to your computer and use it in GitHub Desktop.
detect os in bash
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 | |
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
Identify WSL
uname -r
will definately identify a WSL installation:OS detection script
And that script needs some love. ❤️
uname output
🏁 Windows CMD
WSL ⭕ Ubuntu 18.04
👍