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 Answers1

1

Put it into /etc/bash_completion.d

  • 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? –  Mar 17 '20 at 15:28
  • 2
    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). – Adam Katz Mar 17 '20 at 15:57