From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] setting u-boot params based on serial number
Date: Mon, 26 Oct 2009 15:12:48 +0100 [thread overview]
Message-ID: <20091026141248.AE75E28B9B@gemini.denx.de> (raw)
In-Reply-To: <memo.20091026132928.2092l@postmaster+dexdyne.com.cix.co.uk>
Dear "David Collier",
In message <memo.20091026132928.2092l@postmaster+dexdyne.com.cix.co.uk> you wrote:
>
> I concede I can indeed do the one thing I need here by using decimal
> values with hex arithmetic, and it will give the right answer.
>
> though it is truly horrible coding :-)
You misunderstand. You misunderstand completly.
Exstracting the last N digits from a number using '%' is independent
of the number base.
> I can see situations where I'd want to do something like "add one to the
> last serial number I used" where decimal arithmetic would be needed.
Not for the addition itself :-)
> For myself, I don't see any reason why an arithmetic command shouldn't be
> a special case ( in having the option to work in various bases ), it's
> doing a special job.
What probably would make sense and could be helpful for more advanced
scripting is something like a sprintf command that would allow you to
output (and store the result in a new environment variable) the
content of one or more environment variables in a specific format,
plus regexp support for setexpr.
Volunteers wellcome.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Why don't you have a Linux partition installed so you can be working
in a programmer-friendly environment instead of a keep-gates'-bank-
account-happy one? :-) -- Tom Christiansen
prev parent reply other threads:[~2009-10-26 14:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-23 16:52 [U-Boot] setting u-boot params based on serial number David Collier
2009-10-23 16:58 ` Ben Warren
2009-10-23 18:03 ` Wolfgang Denk
2009-10-23 20:13 ` David Collier
2009-10-23 20:38 ` David Collier
2009-10-23 21:05 ` Wolfgang Denk
2009-10-23 21:04 ` Wolfgang Denk
2009-10-26 10:36 ` David Collier
2009-10-26 12:01 ` Wolfgang Denk
2009-10-26 13:29 ` David Collier
2009-10-26 14:12 ` Wolfgang Denk [this message]
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=20091026141248.AE75E28B9B@gemini.denx.de \
--to=wd@denx.de \
--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