From 181aca448b100c056cb25c60ffb2f8c7e32a9eac Mon Sep 17 00:00:00 2001 From: Ben White Date: Mon, 18 Jun 2018 10:38:02 +1000 Subject: [PATCH] switch $(uname) to $OSTYPE in case example --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0f2e97d..3563573 100644 --- a/README.md +++ b/README.md @@ -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" ;;