1

I have a Bash completion script. Is there a place I can put it on my system, so that it will be automatically source-ed for any user that uses a Bash shell?

I would prefer a solution that does not require me to edit a configuration file in each user's $HOME directory.

1 Answer 1

2

Put it into /etc/bash_completion.d

2
  • Thanks. That directory does not exist on my system. If I create it, will those scripts be loaded automatically or is there some more configuration required? Commented Mar 17, 2020 at 15:28
  • 3
    Yes, but only if those users include a command like . /etc/bash_completion in their bashrc files or in /etc/bash_profile (/etc/bash.bashrc on Debian/Ubuntu, where this code exists but is commented). This actually requires the bash-completion package to be installed on your system (which I highly recommend). Commented Mar 17, 2020 at 15:57

You must log in to answer this question.