From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Chargin Date: Wed, 09 Apr 2014 14:09:00 -0700 Subject: [U-Boot] How can I save U-Boot env vars to HUSH shell vars. Message-ID: <5345B6EC.6050109@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de I'd like to store the values of environment variables in HUSH shell variables and then restore them later. My ultimate goal is to preserve a few environment variables through a "env default -f". I'm working with U-Boot 2010.12. Changing to a newer version is not possible at this time. I realize this is a very old U-Boot. I'm hoping that the relevant parts of U-Boot have not changed between that old version and versions you might provide help for. I tried a few things and haven't found the right combination. I think the following commands demonstrate my problem. Given the U-Boot commands => setenv e "e ethaddr ipaddr rootpath" => => printenv e ethaddr ipaddr rootpath e=e ethaddr ipaddr rootpath ethaddr=00:00:17:88:09:36 ipaddr=10.3.134.80 rootpath=/home/anyuser/a/device/tr/rootfs => => for i in $e; do v_$i=$i; done => What I get: => showvar HUSH_VERSION=0.01 v_e=e v_ethaddr=ethaddr v_ipaddr=ipaddr v_rootpath=rootpath => What I want: => showvar HUSH_VERSION=0.01 v_e=e ethaddr ipaddr rootpath v_ethaddr=00:00:17:88:09:36 v_ipaddr=10.3.134.80 v_rootpath=/home/anyuser/a/device/tr/rootfs => So, how do I re-write the for loop to get the desired results Thanks for any help, Jim -- Jim Chargin AJA Video Systems jimc at aja.com (530) 271-3334 http://www.aja.com