Bash can be running on linux but also on other implementations and systems like windows or MacOS.
So it become useful for a script to detect where is it running to adapt properly.
There are several ways to do this:
OSTYPE value | Environment |
---|---|
|
Linux |
|
MacOS |
|
Cygwin on windows |
|
MinGW (lightweiht shell and GNU utils compiled for windows), Git BASH |
? | FreeBSD |