Skip to content

Instantly share code, notes, and snippets.

@thuyetbao
Created August 12, 2022 12:27
Show Gist options
  • Save thuyetbao/51677693059ced9183a5020c943c02d1 to your computer and use it in GitHub Desktop.
Save thuyetbao/51677693059ced9183a5020c943c02d1 to your computer and use it in GitHub Desktop.
Question: How to detect the Operation from a Bash script?
# Get idea on: https://stackoverflow.com/a/18434831
case "$OSTYPE" in
msys*)
echo "OS: Window"
export PY_CMD=python
export ACTIVATE_DIR=Scripts
;;
linux*)
echo "OS: Linux"
export PY_CMD=/usr/local/bin/python3.9
export ACTIVATE_DIR=bin
;;
*)
echo "Not supported for OS $OSTYPE"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment