Displaying an environment variable value (printenv command)

To display the values of environment variables, use the printenv command.

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

For example, to find the current setting of the MAILMSG environment variable, type the following:
printenv MAILMSG
The command returns the value of the MAILMSG environment variable. For example:
YOU HAVE NEW MAIL