lib.sh: condense setvars() a bit

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit2
Leah Rowe 2024-06-25 00:22:42 +01:00 committed by Leah Rowe
parent 8c06c62e06
commit ae28debf21
1 changed files with 3 additions and 6 deletions

View File

@ -27,13 +27,10 @@ err_()
setvars()
{
_setvars=""
[ $# -lt 2 ] && $err "setvars: too few arguments"
val="$1" && shift 1
for var in $@; do
_setvars="" && [ $# -lt 2 ] && $err "setvars: too few arguments"
val="$1" && shift 1 && for var in $@; do
_setvars="$var=\"$val\"; $_setvars"
done
printf "%s\n" "${_setvars% }"
done; printf "%s\n" "${_setvars% }"
}
chkvars()
{