bash - 如何将自动完成列表传递给 shell 中的管道?

标签 bash shell

在 shell 中我们这样做:ls lTab 然后我们得到从 l 开始的文件列表。

问题是:在 shell 中,如何制作这样的东西 ls lTab| cat 使用 Tab 或不自动完成但不使用模式 ls l*

最佳答案

你真的是说 shell 吗?我认为你的意思是 bash。 :-)

bash 中的自动完成可以像这样手动调用:

compgen -C ls -f 

查看 bash 手册页以及关键字 compgencomplete

如果找不到 compgencomplete 的手册页,请查看 man bash

关于bash - 如何将自动完成列表传递给 shell 中的管道?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24649491/

相关文章:

bash - 全局安装的 NPM 包(带 CLI)返回命令未找到

bash - bash 命令 : date --date @. 中的 @ 符号是什么意思 ..?

linux - cronjob 没有按预期工作

linux - 使用 Bash 检测网关/路由器 : Functions and Variables.

shell - 如何使用 awk 或 shell 脚本计算频谱?

shell - 如何在 shell 脚本中解析配置文件 (*.conf)?

bash - 带有 if 语句的 Grep 命令

bash - 在远程 Linux 主机上执行本地脚本

bash - Bash 变量赋值中找不到命令错误

linux - 连接后无法在主机上正确运行脚本