开发者

What does shopt -s dirspell do?

开发者 https://www.devze.com 2023-03-14 19:41 出处:网络
I cannot figure it out, i understand shopt -s cdspell but cannot find out what shopt -s dirspell does.

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 spell开发者_开发百科ing 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


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 set the shell options direxpand and dirspell, then the tab-completion does work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号