lib.sh: condense setvars() a bit

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit6
Leah Rowe 2024-06-25 00:22:42 +01:00
parent 1387dc0ae2
commit c79fb125eb
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()
{