shopt-option

expand_aliases

Enable alias expansion in a noninteractive shell when deliberately needed.

Formal Syntax & Structure

bash syntaxbash
shopt -s expand_aliases

Return Value

exit status

Enable alias expansion in a noninteractive shell when deliberately needed.

Working Example

Example Snippetbash
shopt -s expand_aliasesalias bmhello='printf "%s\n" hello'bmhellounalias bmhelloif alias bmhello >/dev/null 2>&1; then exit 1; fi
Bash Reference