complete是bash shell的一个内建命令,使用 man complete 或 man bash 可以查看其帮助.
该命令的作用就是规定参数如何自动补全.包括:
Path-name completion 路径名的补全
File-name completion 文件名的补全
User-name completion 用户名的补全
Host-name completion 主机名的补全
Variable-name completion 变量名的补全
-F选项用于执行shell函数.
我相信看到这里你也还是不会明白的.
其实,这条命令的意思就是:
告诉bash当检测到命令行的第一个字段为lunch时(shell根据空格分割解释),就自动调用_lunch函数来执行completion.
参考:
google搜索:
linux shell "complete -F"
搜索结果第一页最下面一个:
Tab-completion for your command-line apps – The If Works