[Bash-completion-devel] [bash-completion-Bugs][312644] Bash completion broken when a file contains ?

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Mon Aug 23 19:48:02 UTC 2010


Bugs item #312644, was changed at 2010-08-07 23:33 by Freddy Vulto
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312644&group_id=100114

Status: Open
Priority: 3
Submitted By: Philip Muskovac (yofel-guest)
>Assigned to: Freddy Vulto (fvu-guest)
Summary: Bash completion broken when a file contains ? 
Distribution: Ubuntu
Originally reported in: Ubuntu Launchpad
Milestone: 1.2
Status: None
Original bug number: 614838


Initial Comment:
$ touch file1 'file?'
$ cat file<tab>
bash: [: file?: binary operator expected

bash-completion 1:1.2-2ubuntu1

----------------------------------------------------------------------

>Comment By: Freddy Vulto (fvu-guest)
Date: 2010-08-23 21:47

Message:
I cannot reproduce the problem with latest git HEAD or bash-completion-1.2:

    $ set -x
    $ touch file1 'file?'
    $ cat file<TAB>
    ...
    + toks=(${toks[@]-} $(
                    compgen -f -X "$xspec" -- $quoted
                ))
    ++ compgen -f -X '' -- file
    + '[' 3 -ne 0 ']'
    + compopt
    + [[ -n cat ]]
    ++ complete -p cat
    + [[ complete -o filenames -F _longopt cat == *\-\o\ \f\i\l\e\n\a\m\e\s* ]]
    + COMPREPLY=("${COMPREPLY[@]}" "${toks[@]}")

    file?  file1

However, I can reproduce the problem with the older bash-completion-1.1:

    $ set -x
    $ touch file1 'file?'
    $ cat file<TAB>
    ...
    + toks=(${toks[@]-} $(
        compgen -f -X "$xspec" -- "$(quote_readline "$cur")" | {
        while read -r tmp; do
            [ -n $tmp ] && echo $tmp
        done
    }
    ))
    +++ quote_readline file
    +++ '[' -n '' ']'
    +++ local t=file
    +++ echo ''\''file'\'''
    ++ compgen -f -X '' -- ''\''file'\'''
    ++ read -r tmp
    ++ '[' -n file1 ']'
    ++ echo file1
    ++ read -r tmp
    ++ '[' -n 'file?' file1 ']'
    bash: [: file?: binary operator expected
    ++ read -r tmp
    + COMPREPLY=("${COMPREPLY[@]}" "${toks[@]}")
    1 

Are you sure you're using the latest bash-completion-1.2 and not 1.1?  If you're using 1.2, what's your output with a `set -x'?

Freddy Vulto
http://fvue.nl

----------------------------------------------------------------------

Comment By: Ville Skyttä  (scop-guest)
Date: 2010-08-09 08:27

Message:
I cannot reproduce with current git, bash 4.1.7.

----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312644&group_id=100114



More information about the Bash-completion-devel mailing list