Assessing Environment Variables
The bash shell also utilizes many environment variables. Although environment variables aren't commands, they often affect how shell commands operate, so it's important to know the shell environment variables. Table A.3 shows the default environment variables available in the bash shell.
Table A.3 bash Shell Default Environment Variables
Variable | Description |
* |
Contains all the command line parameters as a single text value |
@ |
Contains all the command line parameters as separate text values |
# |
The number of command line parameters |
? |
The exit status of the most recently used foreground process |
- |
The current command line option flags |
$ |
The process ID (PID) of the current shell |
! |
The PID of the most recently executed background process |
0 |
The name of the command from the command line |
_ |
The absolute pathname of the shell |
BASH |
The full filename used to invoke the shell |
BASHOPTS |
Enabled shell options in a colon-separated list | ...