1 2 3 4 5 6 7 8 9
#!/bin/bash os="unknown" if [[ "$OSTYPE" == "darwin"* ]]; then echo "mac" elif [[ "$OSTYPE" == "linux-gnu" ]]; then echo "linux" fi