On Sat, 23 Oct 2021, Sven Schreiber wrote:
Hi all,
the doc says that $sysinfo.os gives "linux", "osx",
"windows" or other
as a piece of introspection. An older accessor is $windows, which
returns 0 or 1.
So the $windows accessor appears redundant and doesn't cover the Mac -
should it perhaps be discouraged for new hansl scripts? (I guess
$sysinfo.os has been around long enough such that there are no real
compatibility issues.) At least I guess the doc for $windows should also
point to $sysinfo.os.
As a further minor point, AFAIK MacOS is not named "OS X" anymore. But
obviously, changing the return string to "macos" or something like that
would raise backwards compatibility problems. Again, maybe the easiest
thing is simply to add a note to the doc?
My take on this is that it's very unlikely that anyone wants to
branch in a script based on "osx" versus "linux" since they're
both
at core unix variants. So we should be safe just updating the string
under $sysinfo.os from "osx" to "macos".
MS Windows is definitely the odd man out. For that reason I'd say
it's worth preserving the $windows accessor, which is a lightweight
alternative to producing the full $sysinfo bundle if a script or
package writer just wants to enable special treatment for Windows.
Allin