mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
fix(shell-completion): strictly parse env output
shell functions may be exported, when env prints their body in multiple lines
This commit is contained in:
@@ -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(){
|
||||
|
||||
Reference in New Issue
Block a user