Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ env(1) — SunOS 5.5

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sh(1)

exec(2)

profile(4)

environ(5)

env(1)

NAME

env − obtain or alter environment variables for command execution

SYNOPSIS

env [−i | −] [name=value] ... [utility [ args ]]

AVAILABILITY

SUNWcsu

DESCRIPTION

The env utility will obtain the current environment, modify it according to its arguments, then invoke the utility named by utility operand with the modified environment. 

Optional arguments will be passed to utility.

If no utility operand is specified, the resulting environment will be written to the standard output, with one name=value pair per line. 

OPTIONS

The following options are supported:

−i | − Ignore the environment that would otherwise be inherited from the current shell.  Restricts the environment for utility to that specified by the arguments. 

OPERANDS

The following operands are supported:

name=value Arguments of the form name=value modify the execution environment, and are placed into the inherited environment before utility is invoked. 

utility The name of the utility to be invoked.  If utility operand names any of the special shell built-in utilities, the results are undefined. 

args A string to pass as an argument for the invoked utility. 

EXAMPLES

The following utility:

example% env -i PATH=/mybin mygrep xyz myfile

invokes the utility mygrep with a new PATH value as the only entry in its environment.  In this case, PATH is used to locate mygrep, which then must reside in /mybin. 

ENVIRONMENT

See environ(5) for descriptions of the following environment variables that affect the execution of env: LC_CTYPE, LC_MESSAGES, and NLSPATH. 

EXIT STATUS

If utility is invoked, the exit status of env will be the exit status of utility; otherwise, the env utility will exit with one of the following values:

0 The env utility completed successfully. 

1-125 An error occurred in the env utility. 

126 The utility specified by utility was found but could not be invoked. 

127 The utility specified by utility could not be found. 

SEE ALSO

sh(1), exec(2), profile(4), environ(5)

SunOS 5.5  —  Last change: 1 Feb 1995

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026