Skip to contentSkip to conversation

hush shell script commands(eval)

U-Boot rudresh 1 participant 1 message Dec 24, 2008

lore
Share & tools
lore

rudresh

author
#0 lore raw

Hi All
Mary Christmas . Happy New Year.

I have some query on hush shell script language.

I'm using hush shell script to automate the testing for command
exists in U-boot.
The scripts is as follows

echo --------------------------------------
echo Target Test:
setenv check 'if imi FE7E0000; then val=1; else val=0; fi'
print check
run check
echo --------------------------
echo FRAM Command Test
echo --------------------------------------
setenv check 'if fram; then val_fram=1; else val_fram=0; fi' print check
run check
echo --------------------------------------
echo $val
echo $val_fram
echo ------------------------------------
setenv check 'if $val; then echo imi command executes Success; else echo imi commd Fails; fi'
print check
run check
echo >>>>>>>>>>>>>>>>>>>>>>>>
setenv check 'if $val_fram; then echo fram command executes Success; else echo fram commd Fails; fi'
print check
run check
echo END Test

If i execute this string I?m getting this error.

check=if ($val); then echo command executes Success; else echo imi commd Fails; fi
Unknown command '(0)' - try 'help'
imi commd Fails

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

check= if $val_fram; then echo fram command executes Success; else echo fram commd Fails; fi
Unknown command '1' - try 'help'

I?m not able to fix this error. is it not support the constant value in if then else fi statement?. Is there any alternate method?

I also trying to use the standalone application, is there any command like system("command") in u-boot. i want to run command in U-boot using standalone application.

please help me.

Thanks & Regards,
Rudresh

Signature · 2 lines
View this message in context: http://www.nabble.com/Re%3Ahush-shell-script-commands%28eval%29-tp21156593p21156593.html
Sent from the Uboot - Users mailing list archive at Nabble.com.