diff options
author | Leah Rowe <leah@libreboot.org> | 2024-06-25 00:22:42 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2024-06-25 00:22:42 +0100 |
commit | c79fb125eb798611269990eeda1affbe50e9665e (patch) | |
tree | 41615e6a6561cdfffae863731c610a72be242b6c /include/lib.sh | |
parent | 1387dc0ae2912e09d092ece9b159f01061b0f521 (diff) |
lib.sh: condense setvars() a bit
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/lib.sh')
-rwxr-xr-x | include/lib.sh | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/include/lib.sh b/include/lib.sh index 85f3ac49..907cde47 100755 --- a/include/lib.sh +++ b/include/lib.sh @@ -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() { |