ipset bash auto complete error on ubuntu 18.04
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ipset (Ubuntu) |
Expired
|
Low
|
Unassigned |
Bug Description
I have tested it on a brand new Ubuntu 18.04 amd64 system, then install the ipset package
when I type "ipset " and press tab to trigger bash auto completion,
it returns "-bash: syntax error near unexpected token `;;'".
ipset version: ipset v6.34, protocol version: 6
here is the full log, and I can see it fail when excuting eval _ipset_
+ local cur prev cword words ips_version
+ local str_action str_setname str_type str_filename
+ local str_glob str_regex str_prefix str_suffix
+ local str_tmp= str_var=
+ local str_timeout=timeout 'str_order=before after' str_forceadd=
+ local str_counters= str_bp_counters= str_comment= str_markmask=
+ local str_skbinfo= str_skbflags=
+ local -i i=x=y=0
+ local -i got_bashcompl=
+ local -i got_bp_proto=0
+ local -i ignore_
+ arr_sets=()
+ arr_types=()
+ arr_members=()
+ arr_unknown_opts=()
+ local arr_sets arr_types arr_members arr_unknown_opts
+ arr_dupe_
+ arr_used_opts=()
+ arr_tmp=()
+ local arr_dupe_cmd_opts arr_used_opts arr_tmp
+ arr_opts=("-! -exist" "-o -output" "-q -quiet" "-r -resolve" "-s -sorted" "-n -name" "-t -terse" "-f -file")
+ local arr_opts
+ arr_icmp_
+ local arr_icmp_types
+ arr_icmp6_
+ local arr_icmp6_types
+ (( 4 < 4 ))
+ COMPREPLY=()
++ ipset version
+ ips_version='ipset v6.34, protocol version: 6'
+ ips_version='6.34, protocol version: 6'
+ ips_version=6.34
+ read -a ips_version
+ [[ 6 = +([[:digit:]]) ]]
+ (( ips_version[0] < 6 ))
+ (( ips_version[0] > 6 ))
+ (( ips_version[0] == 6 ))
+ (( ips_version[1] >= 22 ))
+ str_comment=comment
+ str_markmask=
+ str_forceadd=
+ str_skbinfo=skbinfo
+ str_skbflags=
+ got_bp_proto=1
+ declare -f _get_comp_
+ got_bashcompl=1
+ _get_comp_
+ 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 cword words
+ case $flag in
+ exclude=:
+ getopts c:i:n:p:w: flag -n : cur prev cword words
+ [[ 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
+ vcword=cword
+ let 'OPTIND += 1'
+ [[ 6 -ge 6 ]]
+ case ${!OPTIND} in
+ vwords=words
+ let 'OPTIND += 1'
+ [[ 6 -ge 7 ]]
+ __get_cword_
+ words=()
+ local cword words
+ __reassemble_
+ local exclude i j line ref
+ [[ -n : ]]
+ exclude=:
+ printf -v cword %s 1
+ [[ -n : ]]
+ line='ipset '
+ (( i=0, j=0 ))
+ (( i < 2 ))
+ [[ 0 -gt 0 ]]
+ ref='words[0]'
+ printf -v 'words[0]' %s ipset
+ line=' '
+ [[ 0 == 1 ]]
+ (( i++, j++ ))
+ (( i < 2 ))
+ [[ 1 -gt 0 ]]
+ [[ '' == +([:]) ]]
+ ref='words[1]'
+ printf -v 'words[1]' %s ''
+ line=' '
+ [[ 1 == 1 ]]
+ printf -v cword %s 1
+ (( i++, j++ ))
+ (( i < 2 ))
+ [[ 2 == 1 ]]
+ local i cur index=6 'lead=ipset '
+ [[ 6 -gt 0 ]]
+ [[ -n ipset ]]
+ [[ -n ipset ]]
+ cur='ipset '
+ (( i = 0 ))
+ (( i <= cword ))
+ [[ 6 -ge 5 ]]
+ [[ ipset != \i\p\s\e\t ]]
+ [[ 0 -lt 1 ]]
+ local old_size=6
+ cur=' '
+ local new_size=1
+ index=1
+ (( ++i ))
+ (( i <= cword ))
+ [[ 1 -ge 0 ]]
+ [[ '' != '' ]]
+ [[ 1 -lt 1 ]]
+ (( ++i ))
+ (( i <= cword ))
+ [[ -n ]]
+ [[ ! -n '' ]]
+ cur=
+ [[ 1 -lt 0 ]]
+ local words cword cur
+ _upvars -a2 words ipset '' -v cword 1 -v cur ''
+ (( 10 ))
+ (( 10 ))
+ case $1 in
+ [[ -n 2 ]]
+ printf %d 2
+ [[ -n words ]]
+ unset -v words
+ eval 'words=
++ 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=
+ 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+
+ (( 4 ))
+ local cur cword prev words
+ _upvars -v cur '' -v cword 1 -v prev ipset -a2 words ipset ''
+ (( 13 ))
+ (( 13 ))
+ case $1 in
+ [[ -n cur ]]
+ unset -v cur
+ eval 'cur="$3"'
++ cur=
+ 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=ipset
+ shift 3
+ (( 4 ))
+ case $1 in
+ [[ -n 2 ]]
+ printf %d 2
+ [[ -n words ]]
+ unset -v words
+ eval 'words=
++ words=("${@:3:2}")
+ shift 4
+ (( 0 ))
+ (( got_bashcompl ))
+ declare -F _ipset_known_hosts
++ grep --color=auto -Ev '^(\{|\})'
++ grep --color=auto -Ev '^_known_
++ grep --color=auto -v __ltrim_
++ declare -f _known_hosts_real
+ eval '_ipset_
-bash: syntax error near unexpected token `;;'
+ [[ -n '' ]]
+ (( i=1 ))
+ (( i < 2-1 ))
+ [[ -n '' ]]
+ (( names_only && headers_only ))
+ (( names_only || headers_only ))
+ (( ignore_errors ))
+ [[ '' == \$\(* ]]
+ [[ '' == \$\{* ]]
+ [[ '' == \$* ]]
+ case "$prev" in
+ (( got_action ))
+ [[ ipset = - ]]
+ [[ '' = -* ]]
+ (( save_format || names_only || headers_only ))
+ (( res_sort ))
+ (( ignore_errors && use_file ))
+ (( ignore_errors ))
+ (( use_file ))
+ COMPREPLY=($( compgen -W 'create n add del test destroy x list save \
restore flush rename e swap w help version' -- "$cur" ))
++ compgen -W 'create n add del test destroy x list save \
restore flush rename e swap w help version' -- ''
+ [[ -n '' ]]
information type: | Public → Public Security |
information type: | Public Security → Public |
Changed in ipset (Ubuntu): | |
status: | Incomplete → New |
Thank you for you bug report, it seems likely to have to do with the content of ~/.ssh/known_hosts , does it stop if you move that file away? If so could you try to figure what line is creating the issue and share it (or at least describe what it looks like even if you replace names/keys)