0

Question

When using cp command with environment variables, why pressing TAB for auto-complete doesn't work properly?

Description

I have a directory $HOME/Music; I want to copy a file from within this directory to the current directory. Therefore:

  1. I Type cp $HOM and press TAB, so it reads cp $HOME ;
  2. There is an additional space after cp $HOME , therefore I delete it by Backspace and then type a slash:cp $HOME/;
  3. Now Press TAB creates cp \$HOME/ which has a spurious backslash at the beginning of $HOME. When writing further letters i.e. cp \$HOME/Mu for Music, TAB doesn't work for autocompletion.

OS: Ubuntu 20.04

Naghi
  • 157

0 Answers0