Alex Rivera | Logout

What does shopt -s dirspell do?

Asked 2011-06-22T10:25:55.357
15

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

Edit
Report

1 Answer

10

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
answered 2011-06-22T10:50:26.433

Your Answer