getenv
¶
Get or set an environment variable
getenv
¶
Get the value of an environment variable
getenv x getenv[x]
where x
is a symbol atom naming an environment variable, returns its value.
q)getenv `SHELL
"/bin/bash"
q)getenv `UNKNOWN / returns empty if variable not defined
""
setenv
¶
Set the value of an environment variable
x setenv y setenv[x;y]
where
x
is a symbol atomy
is a string
sets the environment variable named by x
.
q)`RTMP setenv "/home/user/temp"
q)getenv `RTMP
"/home/user/temp"
q)\echo $RTMP
"/home/user/temp"