1

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?

  • Same thing on another server running Ubuntu 17 and bash 4.4. – Yehudit Hasin Jan 09 '20 at 10:51
  • I guess that's because of the "programmable completion" which is now the default in most distros. Try `shopt -u progcomp`. Or get rid of it permanently with `apt-get remove --purge bash-completion` if you're not into fixing the completion scriptlets and submitting bug-reports. –  Jan 09 '20 at 18:04

0 Answers0