From 97ed91fa77e3e2926bab3e70955a0e2b511db86e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 14 May 2012 00:21:12 +0200 Subject: [PATCH] jshn.sh: add json_get_vars() wrapper function --- sh/jshn.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sh/jshn.sh b/sh/jshn.sh index d325460..117da67 100644 --- a/sh/jshn.sh +++ b/sh/jshn.sh @@ -104,6 +104,13 @@ json_get_var() { eval "export -- \"$dest=\${${JSON_CUR}_$var}\"" } +json_get_vars() { + while [ "$#" -gt 0 ]; do + local _var="$1"; shift + json_get_var "$_var" "$_var" + done +} + json_select() { local target="$1" local type -- 2.11.0