set-option
Bash set -o noglob
Disables pathname expansion, not word splitting, brace expansion or parameter expansion. Quoting remains important. Use a disposable directory to compare the same pattern with globbing on and off. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): [a.txt]; [b.txt]; [*.txt].
Formal Syntax & Structure
bash syntaxbash
set -o noglob; set +o noglobReturn Value
exit status
Option-setting command returns zero for a valid request; query status is zero if enabled, one if disabled.
Working Example
Example Snippetbash
mkdir filescd files || exit 1touch a.txt b.txtset +o noglobprintf '[%s]\n' *.txtset -o noglobprintf '[%s]\n' *.txt