PreviousUpNext

5.5.7  Look up a key in the linux environment

Look up a key in the unix environment:

    eval:  the (getenv "LOGNAME");
    "jcb"

Look up a key in the linux environment, providing a fallback value in case the key is not found:

    eval:  the_else ((getenv "LOGNAME"), "???");
    "jcb"

Do different things depending on whether key was found:

    eval:  case  (getenv "LOGNAME")   THE name => printf "%s\n" name; NULL => print "LOGNAME not set?!\n"; esac;
    jcb

Print the complete unix environment:

    eval:  apply  {. printf "%s\n" #arg; } (environ ());
    SHELL=/bin/sh
    PATH=/usr/bin:/bin
    HOME=/home/jcb
    LOGNAME=jcb
    USER=jcb

Comments and suggestions to: bugs@mythryl.org

PreviousUpNext