From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Neubacher Date: Sat, 22 Nov 2014 19:23:08 +0100 Subject: [U-Boot] set and test a local variable in a script Message-ID: <5470D48C.1080103@gmx.at> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de hi, i'm trying to set a local variable and test the variable in an if-then-else script ... but it's somehow a bit weird!? - set variable "nea" to 0 - create a script "x" and run .... OK - modify variable "nea" to 1 - run script "x" again ... NOK?! ... what i'm doing wrong - the behavior is the same with 2013.10 and 2014.01 >U-Boot# nea=0 >U-Boot# setenv x "if itest 1 -eq $nea; then echo var1; else echo var0; fi;" >U-Boot# run x >var0 >U-Boot# nea=1 >U-Boot# run x >var0 <<<<<----- so now i should get the "var1" as a result >U-Boot# echo $nea >1 >U-Boot# setenv x "if itest 1 -eq $nea; then echo var1; else echo var0; fi;" >U-Boot# run x >var1 <<<<<------- after i set the script "x" again it's working ... ?! br & thx for any hint, Andy