« Return to Thread: Re: Completion of ENV variables seems to be broken - leading slash (or even more) is added

Re: Completion of ENV variables seems to be broken - leading slash (or even more) is added

by Ryan Gies-2 :: Rate this Message:

| View in Thread

Chet, thank you very much for the patch to bashline.c!

I want make aware my particular use-case. I use ENV variables to alias
different project directories:

     export vh="/var/www/vhosts"
     export lslib="/code/src/lib/perl"
     export lsjs="/code/src/lib/ecma"
     export lsres="/code/src/share/web/res"
     export lsext="/code/src/share/web/ext"
     export lstest="/code/src/test/perl"
     export lsconf="/code/src/share/server"
     export olde="/code/src/share/web/desktop/ext"

Before this fix was introduced I was able to[1]:

     $ cd $vh/ex<TAB><ENTER>

Which would nice place me in my /var/www/vhosts/example.com directory.
However
since this feature[2] the same sequence produces:

     $ cd \$vh/example.com
     bash: cd: $vh/example.com: No such file or directory

Beyond changing directories these aliases aid copying and moving files:

     $ cp $vh/ex<TAB>/ht<TAB>/i<TAB> $vh/loc<TAB>/ht<TAB><ENTER>

Would copy:

     /var/www/vhosts/example.com/htdocs/index.html (to)
     /var/www/vhosts/localhost/htdocs/index.html

--

[1] Given the directory structure:

     /var/www/vhosts/
     |-- example.com
     |   `-- htdocs
     |           `-- index.html
     `-- localhost
         `-- htdocs

[2] Referenced in this thread:
     http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00274.html

 « Return to Thread: Re: Completion of ENV variables seems to be broken - leading slash (or even more) is added