Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
I can use me bash file for complete options –  Stepan Loginov Feb 11 at 17:55
add comment

1 Answer 1

up vote 0 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.