public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Robin Gilks <robin.gilks@tait.co.nz>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Hush 'elif' operation?
Date: Fri, 30 Jan 2004 10:04:08 +1300	[thread overview]
Message-ID: <40197548.6060001@tait.co.nz> (raw)

Greetings

I'm trying to get as close to a switch statement in hush shell language 
as possible and thought that a set of if/then/elif/else would be tidier 
than nested if/then/else. It doesn't work how I expected however. The 
example below illustrates the problem - I was expecting execution after 
a true test (in the first 'if' in this case) to continue after the 'fi' 
but instead it ploughs through all the other executable (echo) 
statements having skipped the elif statements. It does correctly skip 
the else clause however :-))

Could someone assist in the navigation of this module to point out where 
would be a good place to start (i.e. some basic principles and 
assumptions of how the parser works).

[apologies for the word wrapping]

=>if iml; then echo "one"; elif iml; then echo "two"; elif iml; then 
echo "three"; else echo "four"; fi
Image at 40340000:
    Image Name:   Linux-2.4.22-20040129-12:57
    Image Type:   PowerPC Linux Kernel Image (gzip compressed)
    Data Size:    630253 Bytes = 615.5 kB
    Load Address: 00000000
    Entry Point:  00000000

one
two
three
=>


Many thanks

-- 
Robin Gilks
Senior Design Engineer          Phone: (+64)(3) 357 1569
Tait Electronics                Fax  :  (+64)(3) 359 4632
PO Box 1645 Christchurch        Email : robin.gilks at tait.co.nz
New Zealand

             reply	other threads:[~2004-01-29 21:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-29 21:04 Robin Gilks [this message]
2004-02-09 21:52 ` [U-Boot-Users] Hush 'elif' operation? Wolfgang Denk
2004-04-12 14:45 ` 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=40197548.6060001@tait.co.nz \
    --to=robin.gilks@tait.co.nz \
    --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