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.

In 10.04 Terminal I can enter the command: cat $MYDIR/a then hit tab and auto-completion expands it to: cat /home/me/abc.txt

(I have defined MYDIR in my .bashrc)

In 12.04 it auto completes to: cat \$MYDIR/abc.txt and gives a no such file error

How can I get the 10.04 behaviour in this respect?

share|improve this question

1 Answer 1

This one is complex. It is not really a bug, but an unintended consequence of a feature: see this discussion.

But yes, that is the behavior of bash 4.2, and many people have complained that it is a bug. The solution is to either downgrade the bash to the 4.1 version, or upgrade it to 4.2.29, where this bug has been ironed out.

A temporary solution is described here

shopt -s cdable_vars
complete -v -F _cd $nospace $filenames cd
share|improve this answer

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.