0

I want add autocompletion to my script. I wrote bash code for autocomplete (using this tutor http://tldp.org/LDP/abs/html/tabexpansion.html) and put it to /etc/bash_completion.d/ then i execute in bash complete -F _main_complete -o filenames ./script.sh and it's works.

But after reboot I need write this command again.

Sure I can add this to .bashrc, but it looks bad. Where config file for complete located?

1
  • I can use me bash file for complete options Feb 11, 2014 at 17:55

1 Answer 1

0

It appears that, for a login shell,

  1. /etc/profile will source
  2. /etc/profile.d/bash_completions.sh, which will source
  3. /usr/share/bash-completion/bash_completion, which will source
  4. ~/.bash_completion

assuming all those files exist and are readable.

Put your own completions in ~/.bash_completion

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .