*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> env (1)              
Title
Content
Arch
Section
 

ENV(1)

Contents


NAME    [Toc]    [Back]

     env -- set and print environment

SYNOPSIS    [Toc]    [Back]

     env [-i] [name=value ...] [utility [argument ...]]

DESCRIPTION    [Toc]    [Back]

     The env utility executes utility after modifying the environment as specified
 on the command line.  The option name=value specifies an environment
 variable, name, with a value of value.

     The options are as follows:

     -i      Execute the utility with only those environment values specified.
	     The environment inherited by env is ignored completely.

     If no utility is specified, env prints out the names and values of the
     variables in the environment, with one name/value pair per line.

     The env utility is sometimes useful with the ``#!'' construct (see
     execve(2)).  The only difference between ``#!/usr/local/bin/foo'' and
     ``#!/usr/bin/env /usr/local/bin/foo'' is that the latter works even if
     /usr/local/bin/foo is itself interpreted.	Using env this way also allows
     one to reference foo without the path, as well as set up the environment
     as desired.

ENVIRONMENT    [Toc]    [Back]

     The env utility uses the PATH environment variable is used to locate the
     requested utility if the name contains no `/' characters.

DIAGNOSTICS    [Toc]    [Back]

     The env utility exits 0 on success, and >0 if an error occurs.  An exit
     status of 126 indicates utility was found, but could not be executed.  An
     exit status of 127 indicates utility could not be found.

COMPATIBILITY    [Toc]    [Back]

     The env utility accepts the - option as a synonym for -i.

SEE ALSO    [Toc]    [Back]

      
      
     printenv(1), sh(1), execvp(3), environ(7)

STANDARDS    [Toc]    [Back]

     The env utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'').

BUGS    [Toc]    [Back]

     The env utility doesn't handle utility arguments with equal (``='') signs
     in their names, for obvious reasons.


FreeBSD 5.2.1			 May 12, 2003			 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
env IRIX set environment for command execution, print environment
printenv FreeBSD print out the environment
printenv OpenBSD print out the environment
printenv HP-UX print out the environment
printenv Linux print all or part of environment
userenv IRIX print user's login environment
env Tru64 Displays or sets the current environment, or displays the values of environment variables
printenv Tru64 Displays or sets the current environment, or displays the values of environment variables
DXmPrintWgtAugmentList Tru64 Defines additional print formats and lets you add new options to the print widget option menus.
getenv IRIX return value for environment name
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service