autocomplete sh: <( compgen -d — ” ): No such file or directory
http://www.dansketcher.com/2010/01/15/autocomplete-sh-compgen-d-no-such-file-or-directory/Not much of a title, I know, but something for fellow stumped google-wanderers.. I’ve been playing around with deprec for automatically provisioning new servers for my Rails applications. However, I hit a strange problem where certain command-line auto-completions did not work; I’d get an error message like this: $ ls The confusing thing was that only the unpriviliged user exhibited this behaviour, not the root user. I tried reinstalling the bash-completion package to no avail (even an aptitude purge then aptitude install did not work). Eventually I came across this rather long post on bugs.debian.org where someone else has the same problem. Essentially it comes down to the unpriviliged user using /bin/sh as the default shell; under these circumstances autocompletion is supposed to not function (although presumably without error). This is despite /bin/sh being a symlink to /bin/bash The fix, then, is actually quite simple. Change the default shell for all your unprivileged users to bash: # usermod -s /bin/bash dansketcher and then when you make new users, make sure you select bash explicitly: # useradd newuser -m -s /bin/bash |
上面已经说了解决方案,简单说就是:
如果用户已经创建的话,执行以下命令:
# usermod -s /bin/bash dansketcher
如果用户未创建,执行以下命令:
# useradd newuser -m -s /bin/bash
注: 转载自 http://hi.baidu.com/oscarbj/blog/item/d6319bef5e72543badafd541.html