bashenvironment-variablesdollar-sign

What are the special dollar sign shell variables?


In Bash, there appear to be several variables which hold special, consistently-meaning values. For instance,

./myprogram &; echo $!

will return the PID of the process which backgrounded myprogram. I know of others, such as $? which I think is the current TTY. Are there others?


Solution

  • Most of the above can be found under Special Parameters in the Bash Reference Manual. Here are all the environment variables set by the shell.

    For a comprehensive index, please see the Reference Manual Variable Index.