Version 0 of env

Updated 2002-10-09 11:37:00

The env array is a magic name created by Tcl to reflect the value of the invoker's environment; that is to say, when one starts Tcl, what one does is make a request to the operating system to start a new process. If the process is being started directly, that process is typically given a set of variables called environment variables which reflect certain default values. When Tcl starts, it creates the env array and reads the environment. Each environment variable becomes a key in this array whose value is the value of the environment variable.

For instance, on Unix, one will typically find keys like

  • PATH : series of file system directory prefixes, typically seperated by :, which the operating system will apply when asked to execute a file with an incomplete pathname.
  • HOME : name of the user's login directory.
  • LANG : string used to specify internationalization info.