bug-bash
[Top][All Lists]
Advanced

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

Re: completion fails on a filename that contains an equal character


From: Chet Ramey
Subject: Re: completion fails on a filename that contains an equal character
Date: Wed, 6 Mar 2019 09:24:13 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

On 3/6/19 7:59 AM, adff wrote:

> Bash Version: 4.2
> Patch Level: 46
> Release Status: release
> 
> Description:
>     The bash [tab] completion as found on redhat RHEL7.6 fails with a
> filename that has the = character. This happens when there are multiple
> matches for the part before the = character.
>     The behavior is correct when there is only one match, or when the
> readline 'complete-filename' is invoqued using "meta /"
> 
> 
> Repeat-By:
>     touch foo=bar
>     touch foobaz
>     #type
>     ls foo=
>     #press [tab] to get completion
>     ls foo=foo\=bar
>     ls: cannot access foo=foo=bar: No such file or directory

This is because the `=' is one of the characters that breaks words for
the readline word completion code.

Bash allows you to change the set of word break characters by changing
the value of the COMP_WORDBREAKS variable.

If you don't want to do that, you can quote the `=' with a backslash to
get one-time completion.

bash-4.2 is pretty old, but when I try to complete after the `=', I
get `foo=foo'. Programmable completion may change the results.


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



reply via email to

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