Local environment variables

There isn’t a command that displays only local environment variables. The set command displays all of the environment variables set for a specific process. However, this also includes the global environment variables.

Here’s the output from a sample set command.

root@dell:~# set
BASH=/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSION=’3.2.39(1)-release’
COLORTERM=Terminal
COLUMNS=99
DESKTOP_SESSION=IceWM

We’ll notice that all of the global environment variables seen from the printenv command appear in the output from the set command. However, there are quite a few additional environment variables that now appear. These are the local environment variables.

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.