zoukankan      html  css  js  c++  java
  • 让centos使用ubuntu的make命令补全功能

    一直习惯使用debian、ubuntu做开发机,最近it要求各种安全加固,且只提供centos自动化脚本,而ubuntu版本比较乱,14、16、17都要自己整一遍太麻烦,索性换装centos7。

    换了centos,首先感觉make命令不方便。

    make有上百个目标,加一些繁琐的参数,在ubuntu可以用tab自动补全,在centos完全不行。(centos最小安装,已安装bash-completion)

    比如有aaa,bbb,ccc……等目标,加congfig=xxxxx/yyyy,

    在ubuntu只要输入:

    make a[tab] config=x[tab][tab][tab]

    在centos则需要全部手写:

    make aaa config=xxxxx/yyyy

    百度、bing一直没搜到ubuntu、centos在补全方面的讨论。

    最后搜 bash-completion 原理,发现配置脚本在 /etc/bash_completion.d/,遂全部从ubuntu拷贝到centos,重新登陆,不生效。

    因为没有make对应的补全脚本。


    最后拐弯抹角才找到,系统有默认配置,在 /usr/share/bash-completion/completions/

    ubuntu:

    ls /usr/share/bash-completion/completions/|wc -l
    583

    centos:

    ls /usr/share/bash-completion/completions/|wc -l
    192


    差别巨大,难怪debian系的补全功能一直比较好用。

    找到 /usr/share/bash-completion/completions/make 拷贝到centos,问题解决。

  • 相关阅读:
    open-falcon之agent
    centos 7 部署 open-falcon 0.2.0
    高可用Redis服务架构分析与搭建
    python操作mongo脚本
    mongo查询日期格式数据
    离线下载pip包安装
    mongo同步到es
    mongo ttl索引
    kibana多台服务部署
    logstash过滤配置
  • 原文地址:https://www.cnblogs.com/i1022/p/11360223.html
Copyright © 2011-2022 走看看