From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Fri, 07 Sep 2012 11:51:37 +0200 Subject: [U-Boot] common, hush: bug (or feature?) with exit Message-ID: <5049C3A9.9060103@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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