On 11/16/11 7:13 AM, jens.schmid...@arcor.de wrote:
> Hi,
> 
> I have the following problem:
> 
> (Environment or regular) variable FOO contains the path of existing directory 
> "/foo".  When I have a file "/foo/bar" in that directory and when I press TAB 
> in the following commandline ('|' denoting the cursor position)
> 
>   $ cat $FOO/b|<TAB>
> 
> bash expands the commandline to
> 
>   $ cat /foo/bar |
> 
> However, I would like to expand it to
> 
>   $ cat $FOO/bar |
> 
> that is, keep the variable unexpanded, exactly as bash does not expand tilde 
> characters during filename completion.

This is the default bash-4.2 behavior.  There has been some controversy
surrounding the behavior change.  Take a look at

http://lists.gnu.org/archive/html/bug-bash/2011-09/msg00007.html

for a brief discussion of the issues and a patch that adds several things
to make completion work more flexibly in the face of shell variable
expansion.  A version of that patch will appear in bash-4.3.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to