Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I try to do this:

cd ~git\t

where the \t is tab character and I expect it to be expanded by bash_completion to this:

cd ~gitolite/

but it doesn't. I've uncommented the following lines in /etc/bash.bashrc and logged out and back in.

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi

What gives?

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

You probably have:

complete -d cd

try running this:

complete -o bashdefault -d cd

then try your cd ~git\t again.

If that works, add complete -o bashdefault -d cd to your ~/.bashrc, or wherever you put your configs for bash.

share|improve this answer
    
That command did the trick, as long as I have it execute after bash_completion is sourced. I put it at the end of /etc/bash.bashrc with bash_completion enabled above it, then I had to comment out the bash_completion in ~/.bashrc, so now it will work for all users. Cheers! –  weston Feb 11 '11 at 6:18
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.