From: Felix Fietkau Date: Thu, 17 May 2012 12:29:59 +0000 (+0200) Subject: sh/jshn.sh: fix allowing numbers in identifiers X-Git-Url: http://git.archive.openwrt.org/?p=project%2Flibubox.git;a=commitdiff_plain;h=94ff2a0abb2938dc84cc46e513f0d039cacbe40a;ds=sidebyside sh/jshn.sh: fix allowing numbers in identifiers json_add_generic() needs to handle them as well --- diff --git a/sh/jshn.sh b/sh/jshn.sh index 7228adf..7f922c4 100644 --- a/sh/jshn.sh +++ b/sh/jshn.sh @@ -24,7 +24,7 @@ json_add_generic() { var=$(( ${aseq:-0} + 1 )) export -- "SEQ_$cur=$var" else - local name="$(echo -n "$var" | tr -C '[a-zA-Z_]' _)" + local name="$(echo -n "$var" | tr -C '[a-zA-Z0-9_]' _)" [[ "$name" == "$var" ]] || export -- "NAME_${cur}_${name}=$var" var="$name" fi