[U-Boot] common, hush: bug (or feature?) with exit

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

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
participants (2)
-
Heiko Schocher
-
Holger Brunck