Created
March 12, 2019 15:17
-
-
Save thejeff77/43259fd5f0f30a26c86b9562ef865b61 to your computer and use it in GitHub Desktop.
Bash script example - Detect Linux Flavor and run conditional code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
unameOut="$(uname -s)" | |
case "${unameOut}" in | |
Linux*) machine=Linux;; | |
Darwin*) machine=Mac;; | |
CYGWIN*) machine=Cygwin;; | |
MINGW*) machine=MinGw;; | |
*) machine="UNKNOWN:${unameOut}" | |
esac | |
if [${unameOut} -eq “Darwin” ]; then | |
brew install wget | true | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment