Task

Show how to get one of your process's environment variables.

The available variables vary by system;   some of the common ones available on Unix include:

   PATH
   HOME
   USER


MODULE EnvVars EXPORTS Main;
 
IMPORT IO, Env;
 
VAR
  k, v: TEXT;
 
BEGIN
  IO.Put(Env.Get("HOME") & "\n");
 
  FOR i := 0 TO Env.Count - 1 DO
    Env.GetNth(i, k, v);
    IO.Put(k & " = " & v & "\n")
  END
END EnvVars.