interface for using environment variables in Plan 9 is a file
All interfaces of environment variables can be found
obtain the value for a environment variable, from a C program, we can
use the getenv
system call. If the variable is not defined, getenv
returns a null string. A related call is putenv,
which accepts a name and a value, and set the corresponding
environment variable accordingly.
char * path;
sysfatal("path not defined!");
print("PATH is %s /n", path);
some cases it is convenient to define an environment variable just
for a command. This can be
done by defining it in the same command
line, before the command, like in the following exam-ple:
; temp=/tmp/foobar echo $temp
; echo $temp
is updated by the shell once it finds out how it went to the last
command it executed.
is a list of paths where the shell should
look for executable files
to run the user commands.
contains the user name
contains the machine name.
file /dev/text represents
text shown in the window (when used within that window). To make
a copy of your shell session,
you already know what to do:
cp /dev/text $home/saved
same can be done for the image shown in the display for your window,
which is also represented as a file, /dev/window.
This is what we did to capture screen images .