public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] common, hush: bug (or feature?) with exit
@ 2012-09-07  9:51 Heiko Schocher
  2012-09-07 11:10 ` Holger Brunck
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Schocher @ 2012-09-07  9:51 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] common, hush: bug (or feature?) with exit
  2012-09-07  9:51 [U-Boot] common, hush: bug (or feature?) with exit Heiko Schocher
@ 2012-09-07 11:10 ` Holger Brunck
  2012-09-07 11:14   ` Heiko Schocher
  0 siblings, 1 reply; 3+ messages in thread
From: Holger Brunck @ 2012-09-07 11:10 UTC (permalink / raw)
  To: u-boot

Hi Heiko,

On 09/07/2012 11:51 AM, Heiko Schocher wrote:
> 
> I try the following script in u-boot
> ---------------------------------------------------------------------
> setenv error 'if true; then
>         echo **** ERROR ****
>         exit;
> fi'
>

don't know if it helps but AFAIK you need a semicolon to seperate the echo and
the exit command.

Regards
Holger

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] common, hush: bug (or feature?) with exit
  2012-09-07 11:10 ` Holger Brunck
@ 2012-09-07 11:14   ` Heiko Schocher
  0 siblings, 0 replies; 3+ messages in thread
From: Heiko Schocher @ 2012-09-07 11:14 UTC (permalink / raw)
  To: u-boot

Hello Holger,

On 07.09.2012 13:10, Holger Brunck wrote:
> Hi Heiko,
>
> On 09/07/2012 11:51 AM, Heiko Schocher wrote:
>>
>> I try the following script in u-boot
>> ---------------------------------------------------------------------
>> setenv error 'if true; then
>>          echo **** ERROR ****
>>          exit;
>> fi'
>>
>
> don't know if it helps but AFAIK you need a semicolon to seperate the echo and
> the exit command.

Thanks, but that did not help :-(

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-07 11:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-07  9:51 [U-Boot] common, hush: bug (or feature?) with exit Heiko Schocher
2012-09-07 11:10 ` Holger Brunck
2012-09-07 11:14   ` Heiko Schocher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox