Jean-Luc Arnaud on Fri, 20 Sep 2024 18:20:00 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: How to determine if Windows or Mac OS |
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? Jean-Luc Le 20/09/2024 à 17:18, Jean-Luc Arnaud a écrit :
Now I know how to determine the running OS.Unfortunately neither "uname" on Windows nor "ver" on Mac & Linux are known commands, so using them on the wrong OS results in an error message.So, how to avoid this annoying message? TIA Jean-Luc Le 20/09/2024 à 15:55, Bill Allombert a écrit :On Fri, Sep 20, 2024 at 03:46:08PM +0200, Loïc Grenié wrote:Le ven. 20 sept. 2024 à 14:12, Jean-Luc Arnaud <jean-luc@filmsons.com> aécrit :Hi all, I'm writing GP scripts to be used on Windows or Mac OS.Is it possible (and how) to know if the script runs on Windows or Mac OS?Maybe extern("uname")It is safer to use externstr in this case. ? externstr("uname") %3 = ["Linux"] Cheers, Bill