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:

$ lstemp

$ cd [hit tab to get autocomplete]-sh: <( compgen -d -- '' ): No such file or directory-sh: <( compgen -f -X  -- '' ): No such file or directory

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

linux下自动补全问题: autocomplete sh: ( compgen -d — ” ): No such file or directory相关推荐

  1. linux 函数自动补全,Shell脚本中实现自动补全功能

    对于Linuxer来说,自动补全是再熟悉不过的一个功能了.当你在命令行敲下部分的命令时,肯定会本能地按下Tab键补全完整的命令,当然除了命令补全之外,还有文件名补全. Bash-completion ...

  2. Linux下命令补全工具bash-completion

    Linux下超强的命令补全工具bash-completion 编写 Bash 补全脚本 参考URL: https://kodango.com/bash-competion-programming 在使 ...

  3. 使用Linux自定义自动补全命令完善自己的shell脚本

    对于Linuxer来说,自动补全是再熟悉不过的一个功能了.当你在命令行敲下部分的命令时,肯定会本能地按下Tab键补全完整的命令,当然除了命令补全之外,还有文件名补全. Bash-completion ...

  4. shell编程-使用complete实现linux命令自动补全

    一.背景介绍 我们在linux终端操作的时候经常使用tab按键自动补全命令.那么这个是怎么实现的呢?当自己写脚本的时候如何让用户也能自动补全呢?linux提供了两个重要的命令帮助我们实现: compg ...

  5. linux 命令自动补全包

    linux 其他知识目录 rhel7如果使用最小化安装后,tab键默认是不能自动补全命令的 执行yum install bash-completion之后重启系统正常. 转载于:https://www ...

  6. linux命令补全包安装,RED HAT LINUX bash 自动补全命令安装

    RHEL / CentOS 怎么启用bash命令自动补齐功能呢?请看下面 准备工作:系统镜像,配置好yum源. 1.首先需要安装bash-completion 包:[root@server src]# ...

  7. Linux 命令自动补全包bash-completion

    如果按TAB键不能自动补全诸多命令 如 disable.start等,则需要安装bash-completion包 yum -y install bash-completionbash # 使其生效

  8. linux python自动补全_Linux下在python命令行中自动补全代码(py2、3,centos、ubuntu)...

    每次只在shell中测试少量代码,纯手打也有点麻烦 安装ipython也可以实现这个功能,不过破机子有时候反映会稍微卡顿,比较麻烦 1.不管有没有这个文件,直接打开这个文件 vi ~/.pystart ...

  9. Linux下VMware虚拟机报Could not open /dev/vmmon: No such file or directory. Please make sure that the kern

    sudo vmware-modconfig --console --install-all

最新文章

  1. 生成对抗网络(GAN)应用于图像分类
  2. Java设计模式(1)——创建型模式之简单工厂模式(Simple Factory)
  3. using 指令是不需要的和其他两个C#错误
  4. pcb成型板aoi检测_缺陷检测 | PCB AOI质量检测之自动定位核选取算法
  5. java set path_Java Path.setEffect方法代码示例
  6. mesageflow 集成spider 开发思路 手稿
  7. Documentation/x86/kernel-stacks
  8. TensorFlow 实战(五)—— 图像预处理
  9. SiteMesh JSP布局框架介绍
  10. ACL2020 | 词向量性别偏见
  11. boost::algorithm学习
  12. linux桌面图标主题包,推荐 4 款漂亮的 Linux 图标主题
  13. 桌面图标有蓝底怎么办
  14. 2018年年底PC浏览器使用率
  15. CentOS Stream 9 下如何安装使用花生壳并做内网穿透建站
  16. Fluent残差图中continuity不收敛如何处理
  17. 东方通 -- 如何安装、启动、停止、卸载东方通中间件
  18. Ubuntu开机自启动程序的方法
  19. 双非长沙理工排名飙升176反超吉大,湖大连续2年超哈工大 | US News 2023
  20. Python常用库大全及简要说明

热门文章

  1. python代码编辑器PyCharm快捷键补充
  2. bootstrap dialog
  3. 用户密码以BCrypt加密的方式来防范被破解
  4. selenium web的自动化测试工具
  5. sliverappbar高度,SliverAppBar的最小高度(颤振)?
  6. Python数据分析(二):DataFrame基本操作
  7. 数据治理的几个关键要素
  8. java归并算法实例_Java编程中实现归并排序算法的实例教程
  9. linux的文件与目录,linux-文件与目录
  10. 线程池的使用以及其工具类的封装