Skip to content

Instantly share code, notes, and snippets.

@bilalelreda
Created March 1, 2020 03:51
Show Gist options
  • Save bilalelreda/fcf308e67928421e5cac7a517104c18c to your computer and use it in GitHub Desktop.
Save bilalelreda/fcf308e67928421e5cac7a517104c18c to your computer and use it in GitHub Desktop.

Revisions

  1. bilalelreda created this gist Mar 1, 2020.
    15 changes: 15 additions & 0 deletions ostype.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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