Bill Allombert on Sat, 21 Sep 2024 12:56:06 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: How to determine if Windows or Mac OS


On Fri, Sep 20, 2024 at 06:19:24PM +0200, Jean-Luc Arnaud wrote:
> Testing:
> 
> iferr(externstr("uname"),E,externstr("ver"))
> 
> on Windows, I always got an error message, expecting ["", "Microsoft Windows
> [version 6.3.9600]"].
> Same on Mac after swapping Expr1 and Expr2.
> 
> What am I doing wrong?

externstr does not actually raise an error that GP can detect.
The error is internal to the shell.

You can try something like
externstr("ver 2>/dev/null || uname")

But all this is awkward since '\v' will tell you...
Maybe someone has a better idea.

Cheers,
Bill.