.. include:: ../header.txt .. _auto_var: Environment Variables =========================== :title:`Linux for Programmers and Users`, Section 6.3.10 The Bash shell maintains several environment variables that may be useful in shell script programs. Some of these are discussed in :ref:`variables`. The list below represents some of the most commonly used environment variables. =================== ======================================================= Name Meaning =================== ======================================================= :envvar:`$$` The process ID of this shell. :envvar:`$!` The process ID of the last background command. :envvar:`$#` The number of positional parameters. :envvar:`$?` The exit value of the last command. :envvar:`$@` An individually quoted list of all the positional parameters. :envvar:`$HOSTNAME` Hostname of the computer :envvar:`$OLDPWD` The previous working directory of the shell. :envvar:`$OSTYPE` The operating system of the computer. :envvar:`$PPID` The process ID of the shell's parent. :envvar:`$PS1` The setting for the command prompt. See :ref:`ps1`. :envvar:`$PWD` The current working directory of the shell. :envvar:`$UID` The user ID of the user. =================== =======================================================