Re: [U-Boot] [PATCH] cmd_nvedit.c: Add env exists command

2013-10-23 Thread Andrew Ruder
On Wed, Oct 23, 2013 at 06:55:02AM -0700, James Chargin wrote: > I have, more recently, been using scripting of the form > > if test "X" != "X${var}"; then > echo defined > else > echo undefined > fi Thanks for the feedback. I was attempting to do so

Re: [U-Boot] [PATCH] cmd_nvedit.c: Add env exists command

2013-10-23 Thread James Chargin
Dear Andrew Ruder, On 10/22/2013 05:07 PM, Andrew Ruder wrote: env exists is a way to test (in hush) if an environment variable exists. A workaround existed using printenv but this new command doesn't require all the stdout/stderr redirection to prevent printing information to the screen. I w

[U-Boot] [PATCH] cmd_nvedit.c: Add env exists command

2013-10-22 Thread Andrew Ruder
env exists is a way to test (in hush) if an environment variable exists. A workaround existed using printenv but this new command doesn't require all the stdout/stderr redirection to prevent printing information to the screen. Example: $ set testexists 1 $ env exists testexists && echo "yes" yes