keepenv

Description

The runenv variable is a list in which each element contains an environment variable. The format of a runenv element is name=value, where name is the name of an environment variable and value is the current value of that variable.

The keepenv procedure modifies the runenv variable so that it contains only the variables that are listed as input parameters. All other environment variables that are stored in the runenv variable are deleted.

keepenv is typically used to limit the set of environment variables that are available to the current task during execution.

Syntax

keepenv (name1, [,name2, …]);

Arguments

name1 Required. String that contains the name of a task environment variable that should be stored in runenv.
name2 Optional. String that contains the name of a task environment variable that should be stored in runenv.

Return Values

Because keepenv is a procedure, no return value is set.

keepenv ("TERM", "CWD", "PS1");

In this example, runenv contains the environment variables TERM, CWD, and PS1. All other environment variables are deleted from runenv.

For more information, see setenv.