reading OS environment variables

Learning APL or new to Dyalog? Ask "silly" questions here, without fear...

reading OS environment variables

Postby haupz on Mon Jul 23, 2018 11:07 am

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
haupz
 
Posts: 10
Joined: Mon Jul 02, 2018 7:28 am

Re: reading OS environment variables

Postby JohnS|Dyalog on Tue Jul 24, 2018 6:19 am

Hi Michael,
Code: Select all
      ⎕ ← 2 ⎕NQ '.' 'GetEnvironment' 'MY_VAR'
JohnS|Dyalog
 

Re: reading OS environment variables

Postby haupz on Tue Jul 24, 2018 11:27 am

Hi John,

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

Best,

Michael
haupz
 
Posts: 10
Joined: Mon Jul 02, 2018 7:28 am


Return to New to Dyalog?

Who is online

Users browsing this forum: No registered users and 1 guest