Jean-Luc Arnaud on Tue, 24 Sep 2024 13:34:09 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: my attempt to find operating system |
f=default(logfile);
\v
k=readstr(f);
for(i=1, +oo, iferr(b=strsplit(k[i]," "); if(setsearch(b,"darwin")>0, print("MacOS"); return, if(setsearch(b,"mingw")>0, print("Windows");return, if(setsearch(b,"linux")>0, print("Linux"); return))), E, print("OS non déterminé"); return));
default(log,0);
This script seems to work for me
? \l%2 = " amd64 running linux (x86-64/GMP-6.3.0 kernel) 64-bit version"
log = 1 (on)
[logfile is "pari.log"]
? \v
GP/PARI CALCULATOR Version 2.16.2 (development git-cd66bbd045)
amd64 running linux (x86-64/GMP-6.3.0 kernel) 64-bit version
compiled: Apr 25 2024, gcc version 13.2.1 20240206 [revision 67ac78caf31f7cb3202177e6428a46d829b70f23] (SUSE Linux)
threading engine: single
(readline v7.0 enabled, extended help enabled)
? k=readstr("pari.log");
? k[4]
You could parse this line for the operating system.
and then turn off logging again
? \l
log = 0 (off)
[logfile was "pari.log"]