public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] common, hush: bug (or feature?) with exit
Date: Fri, 07 Sep 2012 11:51:37 +0200	[thread overview]
Message-ID: <5049C3A9.9060103@denx.de> (raw)

Hello,

I try the following script in u-boot
---------------------------------------------------------------------
setenv error 'if true; then
         echo **** ERROR ****
         exit;
fi'

setenv foo echo "****************This should not be printed"
setenv loadubi

setenv updfs 'if true; then
         echo; echo ========== Updating rootfs ==========; echo;
         if run loadubi; then
                 echo ***************loadubi
         else;
                 run error
         fi
fi'

echo ========== start ==========

run updfs
run foo
---------------------------------------------------------------------

running it with:

bpp3> source 80008000
## Executing script at 80008000
========== start ==========

========== Updating rootfs ==========

## Error: "loadubi" not defined
**** ERROR ****
****************This should not be printed
bpp3>

I expected that the script (if loadubi is not defined) exits after
the "echo **** ERROR ****", and do not print the line
"****************This should not be printed"

Is this a feature or a bug in hush shell?

Thanks for any hints!

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

             reply	other threads:[~2012-09-07  9:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-07  9:51 Heiko Schocher [this message]
2012-09-07 11:10 ` [U-Boot] common, hush: bug (or feature?) with exit Holger Brunck
2012-09-07 11:14   ` Heiko Schocher

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=5049C3A9.9060103@denx.de \
    --to=hs@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