bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [completion with directory starting with = doesn't work]


From: Chet Ramey
Subject: Re: [completion with directory starting with = doesn't work]
Date: Sat, 09 Jul 2005 13:17:59 -0400
User-agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317)

Djamé Seddah wrote:

>>> I see the same behaviour as posted above.
>>>
>>> # mkdir =foo =foobar
>>> # cd =\=foo
>>> -bash: cd: ==foo: No such file or directory
>>> # echo $BASH_VERSION
>>> 2.05b.0(1)-release
>>>
>>> I get the same result with bash version 3.00.15(1)-release.
>>>
>>> I am not sure if this is related to bash completion package.
>>>   
>>
>>
>> Type `complete cd'.  If you get output, you're using a completion
>> function for cd.  I can't reproduce the problem with stock bash-2.05
>> or 3.0.
>>
>> Chet

OK, I understand the issue now.  It is, as a previous poster suggested,
related to the fact that `=' is one of the word break characters for the
readline completion code.  The word completion functions never see the
`=' at the beginning of the file name.  The insertion of the `\='
happens only when you hit TAB after typing the initial `='.

As of bash-3.0, the set of completion word break characters is available
in the value of the COMP_WORDBREAKS variable.  You can remove `=' from
this set using something like

COMP_WORDBREAKS=${COMP_WORDBREAKS/=/}

and get the behavior you want.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]