My inputrc is empty. I use Bash.
Problem: I am at
cd $te
I press Tab, and I get
cd \$test
How can you have the tab completion without the backslash in Bash?
My inputrc is empty. I use Bash.
Problem: I am at
cd $te
I press Tab, and I get
cd \$test
How can you have the tab completion without the backslash in Bash?
You don't. In Bash, a $ is used in the retrieval of variables. For example:
SWEETVAR='hi'
echo $SWEETVAR
Because of this, a $ in the name of a file or folder must be escaped, else it is interpreted as a var.
The problem seems to be in MacPorts.
It has an old version of Bash_completion.
The newest version has the following in
complete -o nospace -F _cd cd
while I have the following after executing the command
$complete | grep cd
complete -o filenames -o nospace -F _cd cd
I sent a comment to MacPorts' irc to update bash-completion @20060301 (sysutils).
I found another way too to solve the problem partially.
put autocd on by putting the following to your .bashrc
shopt -s autocd
Then, you can avoid the backslash by not typing cd when you change directory.