<html>
    <head>
      <base href="https://bugzilla.netfilter.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - ipset -bash: syntax error near unexpected token `;;'"
   href="https://bugzilla.netfilter.org/show_bug.cgi?id=1443">1443</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ipset -bash: syntax error near unexpected token `;;'
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>ipset
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86_64
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>minor
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P5
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>default
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>netfilter-buglog@lists.netfilter.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>vrein@tuta.io
          </td>
        </tr></table>
      <p>
        <div>
        <pre>- ipset version: ipset v7.6, protocol version: 7
- system: arch linux
- latest git repo has the same code too

There is an additional ; in bash completion script:
grep '_ipset_known_hosts()' -n ./ -R
./utils/ipset_bash_completion/ipset:975:eval '_ipset_known_hosts() { '$(declare
-f _known_hosts_real | grep -v __ltrim_colon_completions | grep -Ev
"^_known_hosts_real.*$" | grep -Ev "^(\{|\})")'; }'
                                                                               
                                                                               
                                                                               
                                                                               
                         ^ - here
Fist semicolon gets into from 
declare -f _known_hosts_real | grep -v __ltrim_colon_completions | grep -Ev
"^_known_hosts_real.*$" |  grep -Ev "^(\{|\})"
pipeline, and on 975 line there is second.

Arch Linux latest:
declare -f _known_hosts_real | grep -v __ltrim_colon_completions | grep -Ev
"^_known_hosts_real.*$" |  grep -Ev "^(\{|\})" | tail -n 5
        for i in "${!COMPREPLY[@]}";
        do
            [[ -n ${COMPREPLY[i]} ]] || unset -v COMPREPLY[i];
        done;
    fi;

Also can reproduce this on Ubuntu 18.04:
declare -f _known_hosts_real | grep -v __ltrim_colon_completions | grep -Ev
"^_known_hosts_real.*$" |  grep -Ev "^(\{|\})" | tail -n 5
        for i in ${!COMPREPLY[@]};
        do
            [[ -n ${COMPREPLY[i]} ]] || unset -v COMPREPLY[i];
        done;
    fi;

And on Ubuntu 20.04 additional semicolon (975 line) are already removed.


Ubuntu 16.04 return a little bit different result, so completion works without
errors.
declare -f _known_hosts_real | grep -v __ltrim_colon_completions | grep -Ev
"^_known_hosts_real.*$" | grep -Ev "^(\{|\})" | tail -n 5
    COMPREPLY+=($( compgen -W         "$( ruptime 2>/dev/null | awk
'!/^ruptime:/ { print $1 }' )"         -- "$cur" ));
    if [[ -n ${COMP_KNOWN_HOSTS_WITH_HOSTFILE-1} ]]; then
        COMPREPLY+=($( compgen -A hostname -P "$prefix$user" -S "$suffix" --
"$cur" ));
    fi;
    return 0

I understand that this is may not be scope of ipset developers, so should I
direct this issue to distro maintainers?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are watching all bug changes.</li>
      </ul>
    </body>
</html>