From: Tom Rini Date: Fri, 8 Nov 2013 17:29:19 -0500 Subject: [U-Boot] cmd_nvedit.c: Add env exists command In-Reply-To: <20131023000734.GA18309@gmail.com> References: <20131023000734.GA18309@gmail.com> Message-ID: <20131108222919.GA5925@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Oct 22, 2013 at 07:07:34PM -0500, 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. > > Example: > $ set testexists 1 > $ env exists testexists && echo "yes" > yes > $ env exists testexists || echo "no" > $ set testexists > $ env exists testexists && echo "yes" > $ env exists testexists || echo "no" > no > $ > > Signed-off-by: Andrew Ruder Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: