Reputation: 861
under Debians BASH I can do the following:
foo=/path/to/some/file
cat $f[TAB]
As you can see, I can autocomplete the variable $foo by pressing TAB.
Under Ubuntu (11) the behaviour is not the same (I've activated '/etc/bash_completion' in my bashrc).
This is working:
echo $f[TAB]
This one is not working:
cat $f[TAB]
Can anyone give me a hint, how to get the last one working?
Upvotes: 2
Views: 500
Reputation: 360133
You can remove the completion specification provided for cat
by /etc/bash_completion
by doing:
complete -r cat
or you can see if modifying the completion options provided in /etc/bash_completion
work in the version of Bash you're using:
complete -F _longopt -o filenames -o bashdefault cat
If you're using the latest patched version of Bash 4.2, there is an option that may help (I haven't tried it):
shopt -s direxpand
Upvotes: 3