来自help compgen:
$ help compgen
compgen: compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]
Display possible completions depending on the options.
Intended to be used from within a shell function generating possible
completions. If the optional WORD argument is supplied, matches against
WORD are generated.
Exit Status:
Returns success unless an invalid option is supplied or an error occurs.[-abcdefgjksuv]代表什么?换句话说,我想知道如何使用所有选项。
发布于 2014-08-20 10:33:43
compgen命令的选项与complete相同,但-p和-r除外。来自compgen手册页:
compgen
compgen [option] [word]
Generate possible completion matches for word according to the options, which
may be any option accepted by the complete builtin with the exception of -p
and -r, and write the matches to the standard output对于选项[abcdefgjksuv]:
-a指别名的名称-b是指shell内置程序的名称。-c是指所有命令的名称-d是指目录的名称-e表示导出的shell变量的名称。-f是指文件的名称-g是指组的名称-j的意思是作业名称-k是指shell保留字的名称。-s是指服务的名称-u是指用户名-v是指shell变量的名称您可以看到完整的手册页这里。
发布于 2020-01-30 13:12:41
在O‘’Reilly,有一本书(阿诺德·罗宾斯快速参考)也有一个提示表单compgen选项在完成时被描述。对于完整的文档,除了上面列出的其他选项外,还提供了其他一些选项。它们可能与当前版本无关,但在当前版本文档中不再有或不再描述选项。
到目前为止,我已经在网上看到这些大写选项被用于调用compgen或在完整的文档中提到!
compgen [option] [word]
complete [-abcdefgjksuv] [-o comp-option] [-A action] [-G globpat] [-W wordlist]
[-P prefix] [-S suffix] [-X filterpat] [-F function]
[-C command] name [name ...]
complete -pr [name ...]在可编程完成内置程序中可以找到一个相当详尽的文档版本。
由于这两个命令都是在命令中构建的,因此官方文档位于本地手册页上,用于bash。使用搜索选项定位其中的相关部件。对不起,但是在任何视图变体中,布局看起来都有些破损(在生成的布局中可用性降低),甚至在internet服务上也是如此。
https://unix.stackexchange.com/questions/151118
复制相似问题