shopt-option
dirspell shell option
During completion, attempts correction of a nonexistent directory name. Distinct from cdspell, which concerns the cd builtin. Do not rely on suggestions for automated filesystem changes. Fixture checks option state only. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): enabled then disabled.
Formal Syntax & Structure
bash syntaxbash
shopt -s dirspell; shopt -u dirspellReturn Value
exit status
Setting or clearing an available option succeeds; a query returns zero when enabled and one when disabled.
Working Example
Example Snippetbash
shopt -s dirspell || exit 1shopt -q dirspell || exit 1shopt -u dirspell || exit 1if shopt -q dirspell; then exit 1; fiprintf "enabled then disabled\n"