Nov 10, 2014

TAB-completion in bash on Fedora 20 escapes the $-Sign of the variable - how to prevent

I'm copying files on the bash command line on Fedora 20.

To deploy a war, I've set the JBOSS_HOME environmentvariable and
deploy the war with

cp target/service.war $JOBSS_HOME/sta

and do here a <TAB> to complete to standalone, but in this case the command line get to

cp target/service.war \$JBOSS_HOME/standalone 

For the next completion of deployment the $ must be unescaped.

I found a hint here.

One way is to enable directory expansion with

shopt -s direxpand

or to use 

<Ctrl>-<Alt>-<e>
 to expand. 

Since the setting of the shell option must be done everywhere, even when logging in to a different server, I tend 
to remember the <Ctrl>-<Alt>-<e> .