[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 4


printenv Command

Purpose

Displays the values of environment variables.

Syntax

printenvName ]

Description

The printenv command displays the values of environment variables. If you specify the Name parameter, the system only prints the value associated with the Name parameter. If you do not specify the Name parameter, the printenv command displays the current environment, showing one Name =Value sequence per line.

If you specify a Name parameter that you have not defined in the environment, the printenv command returns an exit status of 1; otherwise it returns a status of 0 (zero).

Examples

  1. To find the current setting of the MAILMSG environment variable, enter:

    printenv MAILMSG
    
  2. The command returns the value of the MAILMSG environment variable. For example:

    YOU HAVE NEW MAIL
    

Related Information

The env command.

The environment file.

Profiles Overview in AIX 5L Version 5.1 System Management Guide: Operating System and Devices.

Shells Overview in AIX 5L Version 5.1 System User's Guide: Operating System and Devices.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]