From: Andreas Neubacher <a_neubi@gmx.at>
To: u-boot@lists.denx.de
Subject: [U-Boot] set and test a local variable in a script
Date: Sat, 22 Nov 2014 19:23:08 +0100 [thread overview]
Message-ID: <5470D48C.1080103@gmx.at> (raw)
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
next reply other threads:[~2014-11-22 18:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-22 18:23 Andreas Neubacher [this message]
2014-11-22 22:56 ` [U-Boot] set and test a local variable in a script Wolfgang Denk
2014-11-23 16:56 ` Andreas Neubacher
2014-11-23 17:47 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5470D48C.1080103@gmx.at \
--to=a_neubi@gmx.at \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox