From c79fb125eb798611269990eeda1affbe50e9665e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 25 Jun 2024 00:22:42 +0100 Subject: lib.sh: condense setvars() a bit Signed-off-by: Leah Rowe --- include/lib.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'include') 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() { -- cgit v1.2.1