util.environment

built-in shelf

Library: Utilities (OMUTIL)
Import : omutil.xmd

Declaration
export global stream environment variable


Purpose

environment is a global shelf that is populated with the environment variables from the environment used to launch the program. Each environment variable name is stored as the key of a shelf item, and the environment variable value is stored as the value of that shelf item. If you have two or more environment variables with the same name, the last one will be used.

You can use environment just like any other shelf. For instance, you can output the value of all of its keys and corresponding items like this:

  import "omutil.xmd" prefixed by util.
  
  process
     repeat over util.environment as e
        output "util.environment{%"" || key of util.environment || "%"} = " || e || "%n"
    again

Note that while you can change items on the environment shelf, this will not affect the environment used to launch applications using the system-call action.