Skip to content

Instantly share code, notes, and snippets.

@rafaelmaeuer
Created September 23, 2022 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelmaeuer/2f15ad1d164b432c3b0a62d5d1317cd4 to your computer and use it in GitHub Desktop.
Save rafaelmaeuer/2f15ad1d164b432c3b0a62d5d1317cd4 to your computer and use it in GitHub Desktop.
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# ...
elif [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OSX
elif [[ "$OSTYPE" == "cygwin" ]]; then
# POSIX compatibility layer and Linux environment emulation for Windows
elif [[ "$OSTYPE" == "msys" ]]; then
# Lightweight shell and GNU utilities compiled for Windows (part of MinGW)
elif [[ "$OSTYPE" == "win32" ]]; then
# I'm not sure this can happen.
elif [[ "$OSTYPE" == "freebsd"* ]]; then
# ...
else
# Unknown.
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment