bash完成的’have’关键字
发布时间:2020-12-16 01:37:21 所属栏目:安全 来源:网络整理
导读:bash中有关键字吗?还是做bash完成脚本使用不是bash的语言? have gcc _gcc(){ 是很常见.参见:grep“have.*” /etc/bash_completion.d/* 我找不到有关我看到的bash完成教程的任何信息,而且我在man bash中找不到任何信息. google也很难“有”.我在哪里可以找
bash中有关键字吗?还是做bash完成脚本使用不是bash的语言?
have gcc && _gcc() { 是很常见.参见:grep“have.*&&” /etc/bash_completion.d/* 我找不到有关我看到的bash完成教程的任何信息,而且我在man bash中找不到任何信息. google也很难“有”.我在哪里可以找到文档? 我猜测它与确保GATH中存在PATH有关吗? 编辑:是的. / etc / bash_completion包含: have() { unset -v have # Completions for system administrator commands are installed as well in # case completion is attempted via `sudo command ...'. PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type $1 &>/dev/null && have="yes" }
have和_have只是在基础bash_completion文件中定义的两个函数.在两者之间,它们围绕内置类型命令形成一个包装器,以确定特定的命令/程序是否可用.
# This function checks whether we have a given program on the system. # _have() { # Completions for system administrator commands are installed as well in # case completion is attempted via `sudo command ...'. PATH=$PATH:/usr/sbin:/sbin:/usr/local/sbin type $1 &>/dev/null } # Backwards compatibility for compat completions that use have(). # @deprecated should no longer be used; generally not needed with dynamically # loaded completions,and _have is suitable for runtime use. have() { unset -v have _have $1 && have=yes } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 【数据结构】线索化二叉树中序线索化的递归写法和非递归写法
- angularjs – Transclusion(true) – 组合值
- angularjs – 如何在我的角度指令凉亭包中使用单独的模板?
- 服务器端获取webservice客户端IP地址
- WebService学习总结 三 利用本地wsdl文档生成客户端代码和T
- Using existing Bootstrap themes in Liferay (Part II).
- WebMethodAttribute 类
- [angularjs] angularjs系列笔记(一)简介
- Yum安装LAMP(Centos7.2+Apache2.4+Mariadb5.5.56+PHP7.0.24
- scala – 如何在SPARK SQL中使用LEFT和RIGHT关键字
推荐文章
站长推荐
热点阅读