From 395886dfbad28cff608e48172d0a23e9f65836b7 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 28 Feb 2016 16:43:12 -0500 Subject: research: Try storing local vars in eval'd array --- (limited to 'research') diff --git a/research/research6.sh b/research/research6.sh index 3b7d28a..8025ddb 100644 --- a/research/research6.sh +++ b/research/research6.sh @@ -72,16 +72,16 @@ __fn_ctxsw() case "${__prev_vars}" in ?*) unset ${__prev_vars} ;; esac - eval "${__fn_var_vals}" + for __var in ${__fn_vars}; do + eval "${__var}=\${__fn_vars_${__fn_name}__${__var}}" + done } __fn_update_vars() { unset IFS for __var in ${__fn_vars}; do - __val="$(eval "printf '%s' \"\${${__var}}\"" | \ - sed "s|'|'\\\\''|g;")" - __fn_var_vals="${__fn_var_vals} ${__var}='${__val}'" + eval "__fn_vars_${__fn_name}__${__var}=\${${__var}}" done } -- cgit v0.9.1