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.

Weird behavior of a 3rd party (from a windows guy) program (related to python packaging..) confused me a little but this question might explain everything.

Sorry, I don't know pretty much anything about completions. But of course there is some information on the web. I tried to read it, but it is quite late already and I could miss something.

Basically the question is simple:

  • can one put any kind of shell script in a completion,
  • and they are loaded once on the start of the shell and work all the shell's lifetime aren't they?

I mean, a completion file is just a bash script, isn't it?

It just uses some additional built-in bash functions, like complete to set up some "completion space" for the new shell. And it happens on the start of the shell, just like with bashrc. And also completions quite often use lots of functions defined in the completion file. When you call complete in shell you see the list of completions with many names of those functions -- all of them are defined at the start of the shell, they are stored somewhere and they work for this shell all it's lifetime.

Is it correct?

PS And just out of curiosity, where one could look up these functions defined on the start of the shell? Are they listed somewhere, like environment variables?

share|improve this question
And from current directly it sees current executable files and will use those by name. Similar files will only go as far is name is unique. Also type history in command line, that will give you a list of all 500 or now maybe 1000 previous commands. –  oldfred Sep 28 '13 at 0:29
add comment

Your Answer


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

Browse other questions tagged or ask your own question.