From 86fff7fb38a87b521a23505f882b03ed546f40c1 Mon Sep 17 00:00:00 2001 From: Eisuke Kawashima Date: Mon, 14 Jul 2025 16:48:25 +0900 Subject: [PATCH] fix(shell-completion): strictly parse env output shell functions may be exported, when env prints their body in multiple lines --- shell-completion/bash/systemd-nspawn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(){ -- 2.47.3