variable
BASH_CMDS
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.
Formal Syntax & Structure
bash syntaxbash
${BASH_CMDS[name]}Return Value
cached command path
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.
Working Example
Example Snippetbash
hash -rhash cat[[ -n ${BASH_CMDS[cat]} ]] && printf 'cached\n'hash -r[[ ! -v 'BASH_CMDS[cat]' ]] && printf 'cleared\n'