如何在debian postinst脚本中加载bash完成文件

问题描述 投票:2回答:2

我有一个小的debian包,其中包含一个bash完成文件,该文件被复制到/etc/bash_completion.d文件夹中。

安装后,bash完成文件不会“加载”。我必须输入终端:

源/etc/bash_completion.d/mycompletionfile

我想用postinst脚本来避免这种情况。我该怎么办?

谢谢

debian bash-completion
2个回答
1
投票

根据Debian New Maintainers Guide,你必须

  1. bash-completion添加Build-Depends
  2. dh $@ --with bash-completion添加到debian/rules
  3. 创建一个文件debian/package.bash-completion(和读取man dh_bash-completion

0
投票

在shell启动时加载Bash完成文件。如果您安装了一个新的完成文件,它将不会自动加载到现有的shell中,除了源它或source /etc/bash_completion之外别无选择。但是,新的完成应该在没有任何特殊操作的新shell中提供。

© www.soinside.com 2019 - 2024. All rights reserved.