Checking for os in bash
If you need to conditionally run something in macosx that you wouldn't need to run in linux, you can check the $OSTYPE
env var and put it in an if statement like so:
if [[ "$OSTYPE" == 'darwin'* ]]; then
echo 'oh geez on macos';
fi
Tweet