Right now I'm forced to resort to using uname
to get the operating system name and it works. But in bash
there is the OSTYPE
environment variable that is automatically set and I was wondering if there is something similar.
Is there a way to detect OS in fish shell akin to the OSTYPE variable in bash?
3k Views Asked by RubenLaguna At
1
From the fish user documentation it seems that the canonical way to execute code conditionally depending on the operating system type is using a
switch
statement with theuname
results. See example: