[Bash-completion-devel] [bash-completion-Bugs][314667] unexpected EOF when completing inside $(...)

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Tue Apr 29 01:19:35 UTC 2014


bash-completion-Bugs item #314667 was changed at 2014-04-29 01:19 by Mara Kim
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=314667&group_id=100114

Status: Open
Priority: 3
Submitted By: Jay Foad (jayfoad-guest)
Assigned to: Nobody (None)
Summary: unexpected EOF when completing inside $(...) 
Distribution: Ubuntu
Originally reported in: None
Milestone: None
Status: None
Original bug number: 


Initial Comment:
When I try to tab-complete here:

$ ls $(which ls<TAB>

I get these error messages:

bash: unexpected EOF while looking for matching `)'
bash: syntax error: unexpected end of file

I'm using packages bash 4.3-6ubuntu1 and bash-completion 1:2.1-4 on Ubuntu 14.04.

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

Comment By: Mara Kim (mara-guest)
Date: 2014-04-29 01:19

Message:
Unable to attach the file, so here is a dump

BEGIN EXECUTION TRACE
$ echo $(which b+ local compfile=./completions
+ [[ /usr/share/bash-completion/bash_completion == */* ]]
+ compfile=/usr/share/bash-completion/completions
+ compfile+=/echo
+ [[ -f /usr/share/bash-completion/completions/echo ]]
+ complete -F _minimal echo
+ return 124
+ local cur prev words cword split
+ _init_completion -s
+ local exclude= flag outx errx inx OPTIND=1
+ getopts n:e:o:i:s flag -s
+ case $flag in
+ split=false
+ exclude+==
+ getopts n:e:o:i:s flag -s
+ COMPREPLY=()
+ local 'redir=@(?([0-9])<|?([0-9&])>?(>)|>&)'
+ _get_comp_words_by_ref -n '=<>&' cur prev words cword
+ local exclude flag i OPTIND=1
+ words=()
+ local cur cword words
+ upargs=()
+ upvars=()
+ local upargs upvars vcur vcword vprev vwords
+ getopts c:i:n:p:w: flag -n '=<>&' cur prev words cword
+ case $flag in
+ exclude='=<>&'
+ getopts c:i:n:p:w: flag -n '=<>&' cur prev words cword
+ [[ 6 -ge 3 ]]
+ case ${!OPTIND} in
+ vcur=cur
+ let 'OPTIND += 1'
+ [[ 6 -ge 4 ]]
+ case ${!OPTIND} in
+ vprev=prev
+ let 'OPTIND += 1'
+ [[ 6 -ge 5 ]]
+ case ${!OPTIND} in
+ vwords=words
+ let 'OPTIND += 1'
+ [[ 6 -ge 6 ]]
+ case ${!OPTIND} in
+ vcword=cword
+ let 'OPTIND += 1'
+ [[ 6 -ge 7 ]]
+ __get_cword_at_cursor_by_ref '=<>&' words cword cur
+ words=()
+ local cword words
+ __reassemble_comp_words_by_ref '=<>&' words cword
+ local exclude i j line ref
+ [[ -n =<>& ]]
+ exclude='=<>&'
+ eval cword=1
++ cword=1
+ [[ -n =<>& ]]
+ line='echo $(which b'
+ (( i=0, j=0 ))
+ (( i < 2 ))
+ [[ 0 -gt 0 ]]
+ ref='words[0]'
+ eval 'words[0]=${!ref}${COMP_WORDS[i]}'
++ words[0]=echo
+ line=' $(which b'
+ [[ 0 == 1 ]]
+ (( i++, j++ ))
+ (( i < 2 ))
+ [[ 1 -gt 0 ]]
+ [[ $(which b == +([=<>&]) ]]
+ ref='words[1]'
+ eval 'words[1]=${!ref}${COMP_WORDS[i]}'
++ words[1]='$(which b'
+ line=
+ [[ 1 == 1 ]]
+ eval cword=1
++ cword=1
+ (( i++, j++ ))
+ (( i < 2 ))
+ [[ 2 == 1 ]]
+ local i cur index=14 'lead=echo $(which b'
+ [[ 14 -gt 0 ]]
+ [[ -n echo $(which b ]]
+ [[ -n echo$(whichb ]]
+ cur='echo $(which b'
+ (( i = 0 ))
+ (( i <= cword ))
+ [[ 14 -ge 4 ]]
+ [[ echo != \e\c\h\o ]]
+ [[ 0 -lt 1 ]]
+ local old_size=14
+ cur=' $(which b'
+ local new_size=10
+ index=10
+ (( ++i  ))
+ (( i <= cword ))
+ [[ 10 -ge 9 ]]
+ [[  $(which  != \$\(\w\h\i\c\h\ \b ]]
+ cur='$(which b'
+ (( index-- ))
+ [[ 9 -ge 9 ]]
+ [[ $(which b != \$\(\w\h\i\c\h\ \b ]]
+ [[ 1 -lt 1 ]]
+ (( ++i  ))
+ (( i <= cword ))
+ [[ -n $(which b ]]
+ [[ ! -n $(whichb ]]
+ [[ 9 -lt 0 ]]
+ local words cword cur
+ _upvars -a2 words echo '$(which b' -v cword 1 -v cur '$(which b'
+ ((  10  ))
+ ((  10  ))
+ case $1 in
+ [[ -n 2 ]]
+ printf %d 2
+ [[ -n words ]]
+ unset -v words
+ eval 'words=("${@:3:2}")'
++ words=("${@:3:2}")
+ shift 4
+ ((  6  ))
+ case $1 in
+ [[ -n cword ]]
+ unset -v cword
+ eval 'cword="$3"'
++ cword=1
+ shift 3
+ ((  3  ))
+ case $1 in
+ [[ -n cur ]]
+ unset -v cur
+ eval 'cur="$3"'
++ cur='$(which b'
+ shift 3
+ ((  0  ))
+ [[ -n cur ]]
+ upvars+=("$vcur")
+ upargs+=(-v $vcur "$cur")
+ [[ -n cword ]]
+ upvars+=("$vcword")
+ upargs+=(-v $vcword "$cword")
+ [[ -n prev ]]
+ [[ 1 -ge 1 ]]
+ upvars+=("$vprev")
+ upargs+=(-v $vprev "${words[cword - 1]}")
+ [[ -n words ]]
+ upvars+=("$vwords")
+ upargs+=(-a${#words[@]} $vwords "${words[@]}")
+ ((  4  ))
+ local cur cword prev words
+ _upvars -v cur '$(which b' -v cword 1 -v prev echo -a2 words echo '$(which b'
+ ((  13  ))
+ ((  13  ))
+ case $1 in
+ [[ -n cur ]]
+ unset -v cur
+ eval 'cur="$3"'
++ cur='$(which b'
+ shift 3
+ ((  10  ))
+ case $1 in
+ [[ -n cword ]]
+ unset -v cword
+ eval 'cword="$3"'
++ cword=1
+ shift 3
+ ((  7  ))
+ case $1 in
+ [[ -n prev ]]
+ unset -v prev
+ eval 'prev="$3"'
++ prev=echo
+ shift 3
+ ((  4  ))
+ case $1 in
+ [[ -n 2 ]]
+ printf %d 2
+ [[ -n words ]]
+ unset -v words
+ eval 'words=("${@:3:2}")'
++ words=("${@:3:2}")
+ shift 4
+ ((  0  ))
+ _variables
+ [[ $(which b =~ ^(\$\{?)([A-Za-z0-9_]*)$ ]]
+ return 1
+ [[ $(which b == @(?([0-9])<|?([0-9&])>?(>)|>&)* ]]
+ [[ echo == @(?([0-9])<|?([0-9&])>?(>)|>&) ]]
+ local i skip
+ (( i=1 ))
+ (( i < 2 ))
+ [[ $(which b == @(?([0-9])<|?([0-9&])>?(>)|>&)* ]]
+ i=2
+ (( 1 ))
+ (( i < 2 ))
+ [[ 1 -le 0 ]]
+ prev=echo
+ [[ -n false ]]
+ _split_longopt
+ [[ $(which b == --?*=* ]]
+ return 1
+ return 0
+ false
+ _filedir
+ local i 'IFS=
' xspec
+ _tilde '$(which b'
+ local result=0
+ [[ $(which b == \~* ]]
+ return 0
+ local -a toks
+ local quoted x tmp
+ _quote_readline_by_ref '$(which b' quoted
+ '[' -z '$(which b' ']'
+ [[ $(which b == \'* ]]
+ [[ $(which b == ~* ]]
+ printf -v quoted %q '$(which b'
+ [[ \$\(which\ b == *\\* ]]
+ printf -v quoted %s '$(which b'
+ [[ $(which b == \$* ]]
+ eval 'quoted=$(which b'
bash: unexpected EOF while looking for matching `)'
bash: syntax error: unexpected end of file
++ compgen -d -- '$(which b'
+ x=
+ [[ '' != -d ]]
+ xspec=
++ compgen -f -X '' -- '$(which b'
+ x=
+ [[ -n '' ]]
+ [[ 0 -ne 0 ]]

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

Comment By: Mara Kim (mara-guest)
Date: 2014-04-29 01:17

Message:
Also reported in the Debain bug tracker:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742466

I have attached the output of `bash +x` when you type:
    echo $(which b<TAB>


System info:
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu), AKA 4.3-7ubuntu
Ubuntu 14.04 LTS
bash-completion 1:2.1-4
Linux 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

New since Ubuntu 13.10 which used bash 4.2-5ubuntu, bash-completion 1.2.0-1ubuntu

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

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



More information about the Bash-completion-devel mailing list