Skip to content

Instantly share code, notes, and snippets.

@lyndell
lyndell / OSTYPE test
Last active May 16, 2023 04:06
test for the OS with the shell environment variable $OSTYPE
#!/bin/bash -x
#
# From: http://stackoverflow.com/questions/394230/detect-the-os-from-a-bash-script
PLATFORM=$(uname)
case "$PLATFORM" in
"Darwin")
# macOS
;;
"Linux")