Unable to have a tab completion of system variables without a backslash

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?

Upvotes: 2

Views: 595

Answers (3)

I finally moved to Zsh. It solved the problem for me.

Upvotes: 0

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).

Upvotes: 1

Allyn
Allyn

Reputation: 20441

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.

Upvotes: 4

Related Questions