Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
env(1)			    General Commands Manual			env(1)

NAME
       env - set environment for command invocation

SYNOPSIS
       /usr/bin/env [-i	| -] [name=value] ...  [utility	[ arg ...]]

       /usr/xpg4/bin/env [-i | -] [name=value] ...
	    [utility [ arg ...]]

AVAILABILITY
   /usr/bin/env
       SUNWcsu

   /usr/xpg4/bin/env
       SUNWxcu4

DESCRIPTION
       The  env	utility	obtains	the current environment, modifies it according
       to its arguments, then invokes the utility named	by the utility operand
       with the	modified environment.

       Optional	 arguments  are	 passed	 to utility.  If no utility operand is
       specified, the resulting	environment is written to the standard output,
       with one	name=value pair	per line.

   /usr/bin/env
       If  env	executes  commands  with  arguments, it	uses the default shell
       /usr/bin/sh (see	sh(1)).

   /usr/xpg4/bin/env
       If env executes commands	with arguments,	 it  uses  the	XPG4-compliant
       shell  /usr/xpg4/bin/sh,	 which	is  equivalent	to  /usr/bin/ksh  (see
       ksh(1)).

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 environ-
		      ment before utility is invoked.

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

       arg	      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 is the	exit status of
       utility;	otherwise, the env utility is with one of the  following  val-
       ues:

       0	      Successful completion.

       1-125	      An error occurred.

       126	      utility was found	but could not be invoked.

       127	      utility could not	be found.

SEE ALSO
       ksh(1), sh(1), exec(2), profile(4), environ(5)

				  12 Jan 1996				env(1)

NAME | SYNOPSIS | AVAILABILITY | DESCRIPTION | OPTIONS | OPERANDS | EXAMPLES | ENVIRONMENT | EXIT STATUS | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=env&sektion=1&manpath=SunOS+5.5.1>

home | help