In bash, environmental variables not tab-expanding correctly
bash, keyboard-shortcuts, unix
Solution
Try complete -r cd to remove the special programmatic completion function that many Linux distributions install for the `cd` command. The function adds searching a list of of directories specified in the CDPATH variable to tab completions for `cd`, but at the expense of breaking the default completion behavior.
See http://www.gnu.org/software/bash/manual/bashref.html#Programmable-Completion for more gory details.
Problem
In bash, environmental variables will tab-expand correctly when placed after an echo command, for example: ``` echo $HOME ``` But after cd or cat, bash places a \ before the $ sign, like so: ``` cd \$HOME ``` If I use a variable as the second argument to a command, it won't expand at all: ``` cp somefile $HOM ``` What mysterious option do I have in my .bashrc or .inputrc file that is causing me such distress?