switch $(uname) to $OSTYPE in case example

This commit is contained in:
Ben White 2018-06-18 10:38:02 +10:00 committed by GitHub
parent 82813895c9
commit 181aca448b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 5 deletions

View File

@ -1376,17 +1376,21 @@ successful command. `:` always succeeds so we can abuse it to store the
variable value.
```shell
# Example snippet from Neofetch.
case "$(uname)" in
"Linux" | "GNU"*)
# Modified snippet from Neofetch.
case "$OSTYPE" in
"darwin"*)
: "MacOS"
;;
"linux"*)
: "Linux"
;;
*"BSD" | "DragonFly" | "Bitrig")
*"bsd"* | "dragonfly" | "bitrig")
: "BSD"
;;
"CYGWIN"* | "MSYS"* | "MINGW"*)
"cygwin" | "msys" | "win32")
: "Windows"
;;