I am working on a server that runs Ubuntu 18 and bash 4.4, and I have problem with autocompletion and expanding paths stored in environment variable, but only if I use the "more" command:
$ echo $TEST_DIR
$ export TEST_DIR=/home/yhasin/RNAseq_testing
$ echo $TEST_DIR
/home/yhasin/RNAseq_testing
$ ls $TEST_D<Tab> # autocompletes correctly and shows content
$ ls $TEST_DIR
acc_list_test.txt
$ less $TEST_DIR/acc<Tab> # expands correctly into:
$ less /home/yhasin/RNAseq_testing/acc_list_test.txt #shows content correctly
$ more /home/yhasin/RNAseq_testing/acc_list_test.txt #shows correctly
$ cd $TEST_D<Tab> #autocompletes and navigates correctly
But:
$ more $TEST_D<Tab> #Does not expand
$ more $TEST_DIR/acc<Tab> #expands to
$ more \$TEST_DIR/acc_list_test.txt
more: stat of $TEST_DIR/acc_list_test.txt failed: No such file or directory
Why does "more" adds the "\" to the path when it expands it? What do I need to add to my .bashrc to make it the same as all other commands? Are there other particular commands that have this issue?