runenv(8) runtools runenv(8)
NAME
runenv - run a program with a modified environment
SYNOPSIS
runenv [-hV] [-i] [-U acct ] newenv program [ args ... ]
DESCRIPTION
runenv starts program with a modified environment. As distinct from
common versions of env(1), modifications are applied only within the
environment of program; the environment of runenv itself is not
affected.
Modifications for the new environment are specified in the argument
newenv, which is either a file or a directory. If newenv is a - (sin-
gle dash), runenv reads the modifications from standard input as
described for a file.
The argument program may be either a pathname or a filename. If pro-
gram contains a ``/'' (slash) character, it is considered a pathname
and runenv will attempt to invoke it directly. Otherwise, runenv will
perform a shell-like search for program within the directories defined
in the PATH variable of the runtime environment of runenv.
If the argument newenv is a file:
The file newenv is opened and read line by line. A line in the form of
k=v is interpreted as an environmental variable, k, defined with a
value of v. If the variable k does not exist in the current environ-
ment, k=v will be added to the environment of program. If the variable
k does exist in the current environment, its value will be replaced by
v in the environment of program.
A line in the form of k only, without =v, specifies that any existing
variable k will be deleted (unset) from the environment of program.
All names and values read from file are trimmed of leading and trailing
whitespace. Empty lines and lines beginning with ``#'' are ignored.
If the argument newenv is a directory:
Each file k in the directory newenv is interpreted as an environmental
variable k=v, where k is the name of the file, and v is read from the
first line of the file. As above, if the variable k does not exist in
the current environment, k=v will be added to the environment of pro-
gram. If the variable k does exist in the current environment, its
value will be replaced by v in the environment of program.
If the file k is empty, then any existing variable k will be deleted
(unset) from the environment of program.
Filenames in the directory newenv that begin with ``.'' are ignored,
and filenames should not contain ``=''. The values read from files in
newenv are trimmed of leading and trailing whitespace. No special pro-
vision is made for commenting files, except to note that any text
occuring after the first line is ignored.
Escape sequences:
Whether newenv is a file or directory, a limited number of two-charac-
ter escape sequences are supported within value definitions:
``\n'' is changed to newline
``\t'' is changed to tab
``\_'' (backslash + underscore) is changed to single space
``\\'' is changed to single backslash
These escape sequences make it possible to embed newlines in values,
and provide a way to retain leading and trailing whitespace. Any other
``\'' sequences found within a value are left verbatim.
OPTIONS
-h