Page 1 of 1

reading OS environment variables

Posted: Mon Jul 23, 2018 11:07 am
by haupz
Hello,

say I have an env variable set at OS level, e.g.,

Code: Select all

export MY_VAR=something
, and want to read that variable's value in Dyalog. How do I to that?

(Things I found about "environment variables" are usually about the Dyalog env vars, not about pulling in OS env vars.)

Thanks,

Michael

Re: reading OS environment variables

Posted: Tue Jul 24, 2018 6:19 am
by JohnS|Dyalog
Hi Michael,

Code: Select all

      ⎕ ← 2 ⎕NQ '.' 'GetEnvironment' 'MY_VAR'

Re: reading OS environment variables

Posted: Tue Jul 24, 2018 11:27 am
by haupz
Hi John,

thank you, that's interesting. The pointer to the ⎕NQ function made for some new discoveries. :-)

Best,

Michael