[U-Boot-Users] Best way to see if a u-boot environment variable isdefined with a script?

Martin Krause Martin.Krause at tqs.de
Mon Nov 20 17:29:11 CET 2006


Hi,

u-boot-users-bounces at lists.sourceforge.net wrote on Monday, November
20, 2006 5:16 PM: 
> What would be the best way to see if a u-boot variable is defined with
> a script? In other words, I want to check to see if an env variable,
> say 'testvar' is defined from u-boot script (not from the interactive
> command line.) I tried to use itest and printenv, but doesn't seem to
> work.
> 
> Any suggestions?

If the hush shell is configured you could use something like that:

if printenv testvar
  then
    echo "testvar is set"
  else
    echo "testvar is not defined"
fi

Regards,
Martin




More information about the U-Boot mailing list