I cannot figure it out, i understand shopt -s cdspell but cannot find out what shopt -s dirspell does.
The Bash Reference Guide says:
dirspell
If set, Bash attempts spelling correction on directory names during word completion if the directory name initially supplied does not exist.
I tried several times on several directories but that is not the behavior.
I'm using bash 4.2.10(2) on i386-apple-darwin10.7.0
Shopt is a built-in command in Unix-like operating systems, such as macOS and Linux distributions. The “shopt” command provides control over many settings that are used to tweak the operations in a Bash shell.
In bash, shopt -s dotglob is the only way of matching every file in the directory without accidentally matching . or .. . However, fish shell can never match . or .. with globs, therefore that's not an issue (if you seriously need to match . or .. for some silly reason, just say them explicitly).
From the change-log
x. There is a new shell option: `dirspell'. When enabled, the filename completion code performs spelling correction on directory names during completion.
Let's try:
$ ls
spam/
$ cat spam/test
hello world
without dirspell
$ cat span/test [tab]
# nothing happens
with dirspell
$ shopt -s dirspell
$ cat span/test [tab]
#line is replaced by
$ cat /home/user/tmp/shopt/spam/test
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With