From: Eisuke Kawashima Date: Mon, 14 Jul 2025 07:48:25 +0000 (+0900) Subject: fix(shell-completion): strictly parse env output X-Git-Tag: v258-rc1~57^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86fff7fb38a87b521a23505f882b03ed546f40c1;p=thirdparty%2Fsystemd.git fix(shell-completion): strictly parse env output shell functions may be exported, when env prints their body in multiple lines --- diff --git a/shell-completion/bash/systemd-nspawn b/shell-completion/bash/systemd-nspawn index 597c1b681d2..49164fb90c3 100644 --- a/shell-completion/bash/systemd-nspawn +++ b/shell-completion/bash/systemd-nspawn @@ -43,7 +43,7 @@ __get_machines() { __get_env() { local a - env | { while read -r a; do echo " ${a%%=*}"; done; } + env | { while read -r a; do [[ $a =~ ^[A-Za-z0-9_]+= ]] && echo " ${a%%=*}"; done; } } __get_interfaces(){