Next: srfi environment-variables issues, Previous: srfi environment-variables rationale, Up: srfi environment-variables [Index]
The following two procedures belong to the R6RS library named
(system)
. This is a provisional library name until the naming
rules for R6RS SRFI libraries are specified.
Return the value of the named environment variable as a string, or
#f
if the named environment variable is not found. The name
argument is expected to be a string. get-environment-variable
may use locale–setting information to encode the name and decode the
value of the environment variable. If get-environment-variable
can’t decode the value, get-environment-variable
may raise an
exception.
(get-environment-variable "PATH") => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
Return names and values of all the environment variables as an alist.
The same decoding considerations as for get-environment-variable
apply.
(get-environment-variables) => (("PATH" . "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin") ("USERNAME" . "taro"))