我有一个小的debian包,其中包含一个bash完成文件,该文件被复制到/etc/bash_completion.d文件夹中。
安装后,bash完成文件不会“加载”。我必须输入终端:
源/etc/bash_completion.d/mycompletionfile
我想用postinst脚本来避免这种情况。我该怎么办?
谢谢
根据Debian New Maintainers Guide,你必须
bash-completion
添加Build-Depends
包dh $@ --with bash-completion
添加到debian/rules
debian/package.bash-completion
(和读取man dh_bash-completion
)在shell启动时加载Bash完成文件。如果您安装了一个新的完成文件,它将不会自动加载到现有的shell中,除了源它或source /etc/bash_completion
之外别无选择。但是,新的完成应该在没有任何特殊操作的新shell中提供。