tags: linux gnu bash See [the docs](https://tldp.org/LDP/abs/html/internalvariables.html) ## Shorthands ```csv sep=- vert cols=2 $$ - current bash PID of the current script $? - exist status of last command $_ - final arg of last command $! - PID of last background job $- - flags passed to script ``` ## Long names Some are: ```csv sep=- vert cols=2 $BASH - path to bash itself $BASH_ENV - startup file when bash was invoked $BASH_SUBSHELL - subshell level $BASHPID - current bash PID, not the same as $$ $DIRSTACK[@] - dir stack as an array, $DIRSTACK or $DIRSTACK[0] are top of the stack $FUNCNAME - current function name $PIPESTATUS[@] - return codes from elements of last pipe ```