<div dir="ltr"><div>I'm having this curious behavior of bash completion <br></div><div>on Debian 10 (buster) when I'm using environment variables in the command. A simple example is, let's say I have the following file on my filesystem (reading about CVE-2020-0601):</div><div><br></div><div>$HOME/Downloads/CSA-WINDOWS-10-CRYPT-LIB-20190114.PDF</div><div><br></div><div>and I type in the following command:<br></div><div><br></div><div>cp $HOME/Downloads/CSA</div><div><br></div><div>and then I press the [TAB] key followed by the [spacebar] key followed by the [.] key, what happens is that bash completion mistakenly changes the command to:</div><div><br></div><div>cp \$HOME/Downloads/CSA-WINDOWS-10-CRYPT-LIB-20190114.PDF .</div><div><br></div><div>When I press [Enter] key, I obviously get this error:</div><div><br></div><div>cp \$HOME/Downloads/CSA-WINDOWS-10-CRYPT-LIB-20190114.PDF  .<br>cp: cannot stat '$HOME/Downloads/CSA-WINDOWS-10-CRYPT-LIB-20190114.PDF': No such file or directory</div><div><br></div><div>I don't think it should be escaping the $ in this scenario ($HOME is an environment variable, after all). I guess bash is thinking that the $ is "part of the filename" so it's escaping it, but I want bash to think of this $ as a real $ because it's in front of the name of the environment variable, so it shouldn't be escaped in this case. Does bash need a code change to support this kind of thing, or is there a feature I'm missing? I think some distros don't have this issue, but I wasn't paying close enough attention to remember whether I just worked around the issue using "~" instead of $HOME, e.g.:</div><div><br></div><div>cp ~/Downloads/CSA</div><div><br></div><div>and pressing [TAB] key followed by the [spacebar] key followed by the [.] key works fine:</div><div><br></div><div>cp ~/Downloads/CSA-WINDOWS-10-CRYPT-LIB-20190114.PDF .</div><div><br></div><div>But it'd be nice to be able to use environment variables...</div><div><br></div><div>Thanks,</div><div>Peter.<br></div></div>