[ovs] openvswitch ovs ovs-vsctl ovs-appctl 命令行参数自动补全 bash bash-completion

 

1, 安装bash_completion:

[root@vrouter1 ~]# yum install bash-completio

 

2,  找到你的ovs的补全脚本装在了哪里

[root@vrouter1 ~]# ll /usr/local/etc/bash_completion.d/
total 52
-rwxr-xr-x 1 root root 17850 May 22 10:23 ovs-appctl-bashcomp.bash
-rwxr-xr-x 1 root root 28733 May 22 10:23 ovs-vsctl-bashcomp.bash
[root@vrouter1 ~]# 

 

3, source 他们

把如下行

OVS_COMPLE_DIR=/usr/local/etc/bash_completion.d/
for file in `ls $OVS_COMPLE_DIR`
do
    . $OVS_COMPLE_DIR$file    
done

追加进 ~/.bashrc

 

https://github.com/scop/bash-completion

 

posted on 2018-05-22 13:56  toong  阅读(575)  评论(0编辑  收藏  举报