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 will start by mentioning this is a different issue (but perhaps related) to the escaping of dollar signs when tab completing variables.

What I am trying to do is this. When exporting a variable that is supposed to point to a directory I type:

$ export VAR=/home/w<TAB>

What I expect to get is:

$ export VAR=/home/wds

What I get is:

$ export /home/wds

And subsequent tab completions don't appear to work. Is there a way to restore the old behaviour where it would leave the variable name, or a work-around I could employ? Should I report this as a bug?

Edit: The same problem occurs on a new user with a fresh .bashrc. All bash packages are standard ubuntu (latest in raring) and /etc/bash.bashrc does not appear to have been modified.

I am trying to figure out if the problem is related to programmable completion, but when I run complete with '-p' I get:

$ complete -p export
complete -F _export export

Which seems to indicate the built-in function is used. Which is defined by /usr/share/bash-completion/completions/export, which is the default file from the bash-completion package.

Most people seem to have the correct behaviour, judging from the comments. Are you all running raring?

Further investigation indicates I do get the desired behaviour when I uninstall the bash-completion package, so I assume it's a bug in the script for export. I will file a bug.

share|improve this question
I get what you expected. Maybe something is wrong in your .bashrc file ? Ιf that helps, here is the original Ubuntu bashrc and profile files. –  NikTh Jul 8 '13 at 8:21
@NikTh ah that is interesting. I don't have a profile file but that should only matter for shells. I tried with that bashrc file and the behaviour is the same. I assume it's one of the completions in /usr/share/bash-completion/ then, but no idea how to find out which. –  wds Jul 8 '13 at 11:58
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.