Bash Complete Reference Index

Select any item below to open its full syntax specification, parameters, and live example.

Bash Tutorial

invocation-option

5 entries

utility

2 entries

variable

12 entries
BASHOPTS$BASHOPTS
Readonly colon-separated list of enabled shopt options. Export affects a normal child Bash startup; not a guarantee of identical interpreter behavior.
BASH_ALIASES${BASH_ALIASES[name]}
Associative view of Bash alias definitions. Adding entries changes the alias list; unsetting the special variable removes its special properties. Prefer alias and unalias to manage aliases.
BASH_ARGC
Array of argument counts for active shell frames when extended debugging is enabled. Enable extdebug before entering functions whose arguments are inspected. The innermost active frame is first. Enabling extdebug may affect trap behavior; avoid changing production settings merely to collect diagnostics. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): inner=2 outer=1.
BASH_ARGV
Array of arguments from active shell frames, stored in reverse order, when extended debugging is enabled. Enable extdebug before entering the inspected function. Values may contain secrets; never dump the array indiscriminately. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): [two words]; [first].
BASH_CMDS${BASH_CMDS[name]}
Associative view of Bash command hash entries. Adding entries changes the hash table; unsetting the special variable removes its special properties. This example only inspects the view.
BASH_COMMAND$BASH_COMMAND
The command being executed or about to execute; in a trap it describes the command executing when the trap was triggered. Can reveal sensitive information; demonstrate only fixed synthetic code.
BASH_COMPATBASH_COMPAT=4.2
Select specific historical semantics, not an earlier binary. Introduced in 4.3.
BASH_ENVBASH_ENV=/absolute/file bash -c command
Ordinary noninteractive Bash expands the value and executes the named file without searching PATH. Trust its contents and control inherited environment before launch.
BASH_LOADABLES_PATH
Colon-delimited directories searched for loadable builtin objects by enable -f. Such objects contain executable native code; do not load untrusted files. This example tests a missing object using only an empty private search directory; no module is loaded. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): missing module rejected.
BASH_VERSINFO${BASH_VERSINFO[0]}
Readonly array containing major, minor and patch values; use numeric version checks.
BASH_VERSION$BASH_VERSION
Descriptive version string of the running Bash; not suitable for lexical numeric comparison.
BASH_XTRACEFDBASH_XTRACEFD=fd
Route xtrace to an open descriptor. Unsetting closes that descriptor; do not casually use descriptor 2.

arithmetic-operator

1 entry

Showing 20 of 566 entries

Bash Reference & Cheat Sheet | ByteMind