]> git.ipfire.org Git - thirdparty/ipset.git/commitdiff
bash-completion: restore fix for syntax error
authorJeremy Sowden <jeremy@azazel.net>
Fri, 7 Feb 2025 20:08:13 +0000 (20:08 +0000)
committerJozsef Kadlecsik <kadlec@netfilter.org>
Fri, 18 Apr 2025 12:42:23 +0000 (14:42 +0200)
There is a syntax error in a redirection:

  $ bash -x utils/ipset_bash_completion/ipset
  + shopt -s extglob
  utils/ipset_bash_completion/ipset: line 365: syntax error near unexpected token `('
  utils/ipset_bash_completion/ipset: line 365: `done < <(PATH=${PATH}:/sbin ( command ip -o link show ) 2>/dev/null)'

Move the environment variable assignment into the sub-shell.

This fix was previously applied in commit 417ee1054fb2 ("bash-completion:
fix syntax error"), but then reverted, presumably by mistake, in commit
0378d91222c1 ("Bash completion utility updated").

Fixes: 0378d91222c1 ("Bash completion utility updated")
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
utils/ipset_bash_completion/ipset

index d258be234806396a5da14963b0c7a0caaae0e823..fc95d40438653ef09a53734fcf30e72d7688310d 100644 (file)
@@ -362,7 +362,7 @@ _ipset_get_ifnames() {
 while read -r; do
     REPLY="${REPLY#*: }"
     printf "%s\n" ${REPLY%%:*}
-done < <(PATH=${PATH}:/sbin ( command ip -o link show ) 2>/dev/null)
+done < <(( PATH=${PATH}:/sbin command ip -o link show ) 2>/dev/null)
 }
 
 _ipset_get_iplist() {