Dup Goto 📝

PredefinedVariables1

To Pop
22 lines, 113 words, 710 chars Friday 2024-02-23 15:45:29

See the docs

Shorthands

$$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:

$BASHpath to bash itself
$BASH_ENVstartup file when bash was invoked
$BASH_SUBSHELLsubshell level
$BASHPIDcurrent bash PID, not the same as $$
$DIRSTACK[@]dir stack as an array, $DIRSTACK or $DIRSTACK[0] are top of the stack
$FUNCNAMEcurrent function name
$PIPESTATUS[@]return codes from elements of last pipe