All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [U-boot] shell script syntax
@ 2013-07-22  9:46 TigerLiu at viatech.com.cn
  2013-07-22 10:24 ` Albert ARIBAUD
  0 siblings, 1 reply; 8+ messages in thread
From: TigerLiu at viatech.com.cn @ 2013-07-22  9:46 UTC (permalink / raw)
  To: u-boot

Hi, experts:

It seems u-boot script does not support "for / goto" etc syntax?

So, I could not use script to let one cmd run many times?

 

Best wishes,

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

* [U-Boot] [U-boot] shell script syntax
  2013-07-22  9:46 [U-Boot] [U-boot] shell script syntax TigerLiu at viatech.com.cn
@ 2013-07-22 10:24 ` Albert ARIBAUD
  2013-07-22 11:06   ` TigerLiu at viatech.com.cn
  0 siblings, 1 reply; 8+ messages in thread
From: Albert ARIBAUD @ 2013-07-22 10:24 UTC (permalink / raw)
  To: u-boot

Hi TigerLiu at viatech.com.cn,

On Mon, 22 Jul 2013 17:46:38 +0800, <TigerLiu@viatech.com.cn> wrote:

> Hi, experts:
> 
> It seems u-boot script does not support "for / goto" etc syntax?
> 
> So, I could not use script to let one cmd run many times?

See the Denx U-Boot documentation, more precisely:

http://www.denx.de/wiki/view/DULG/CommandLineParsing#Section_14.2.17.

> Best wishes,

Amicalement,
-- 
Albert.

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

* [U-Boot] [U-boot] shell script syntax
  2013-07-22 10:24 ` Albert ARIBAUD
@ 2013-07-22 11:06   ` TigerLiu at viatech.com.cn
  2013-07-22 11:29     ` Albert ARIBAUD
  0 siblings, 1 reply; 8+ messages in thread
From: TigerLiu at viatech.com.cn @ 2013-07-22 11:06 UTC (permalink / raw)
  To: u-boot

Hi, Albert:
>See the Denx U-Boot documentation, more precisely:
>http://www.denx.de/wiki/view/DULG/CommandLineParsing#Section_14.2.17.

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

* [U-Boot] [U-boot] shell script syntax
  2013-07-22 11:06   ` TigerLiu at viatech.com.cn
@ 2013-07-22 11:29     ` Albert ARIBAUD
  2013-07-22 11:44       ` TigerLiu at viatech.com.cn
  0 siblings, 1 reply; 8+ messages in thread
From: Albert ARIBAUD @ 2013-07-22 11:29 UTC (permalink / raw)
  To: u-boot

Hi TigerLiu at viatech.com.cn,

On Mon, 22 Jul 2013 19:06:33 +0800, <TigerLiu@viatech.com.cn> wrote:

> Hi, Albert:
> >See the Denx U-Boot documentation, more precisely:
> >http://www.denx.de/wiki/view/DULG/CommandLineParsing#Section_14.2.17.
> From this web page, it seems hush-shell support "for" iteration.
> So, i wrote a simple script as below:
> for(i=1;i<10;i++)
> do
>     echo "lion-0722"
> done
> 
> Then, i used mkimage tool to produce a script.
> Then, i load it to dram, and run it with autoscr cmd.
> But failed, the log message is:
> LION # fatload mmc 0:1 0 scriptcmd0722
> reading scriptcmd0722
> 120 bytes read
> LION # autoscr 0
> ## Executing script at 00000000
> Unknown command 'for(i=1' - try 'help'
> Unknown command 'i<10' - try 'help'
> Unknown command 'i++)' - try 'help'
> syntax error
> syntax error
> ... ...

Did you try the commands live in your U-Boot console?

Did you make sure hush shell is enabled in your U-boot?

> Best wishes,

Amicalement,
-- 
Albert.

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

* [U-Boot] [U-boot] shell script syntax
  2013-07-22 11:29     ` Albert ARIBAUD
@ 2013-07-22 11:44       ` TigerLiu at viatech.com.cn
  2013-07-22 12:05         ` Albert ARIBAUD
  2013-07-22 13:10         ` James Chargin
  0 siblings, 2 replies; 8+ messages in thread
From: TigerLiu at viatech.com.cn @ 2013-07-22 11:44 UTC (permalink / raw)
  To: u-boot

Hi, Albert:
>Did you try the commands live in your U-Boot console?
>Did you make sure hush shell is enabled in your U-boot?
I am sure I have enabled hush shell.

I think "for" iteration syntax is error:
"for(i=1;i<10;i++)"

But I don't know how to write it correctly!

Best wishes,

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

* [U-Boot] [U-boot] shell script syntax
  2013-07-22 11:44       ` TigerLiu at viatech.com.cn
@ 2013-07-22 12:05         ` Albert ARIBAUD
  2013-07-22 13:10         ` James Chargin
  1 sibling, 0 replies; 8+ messages in thread
From: Albert ARIBAUD @ 2013-07-22 12:05 UTC (permalink / raw)
  To: u-boot

Hi TigerLiu at viatech.com.cn,

On Mon, 22 Jul 2013 19:44:18 +0800, <TigerLiu@viatech.com.cn> wrote:

> Hi, Albert:
> >Did you try the commands live in your U-Boot console?
> >Did you make sure hush shell is enabled in your U-boot?
> I am sure I have enabled hush shell.
> 
> I think "for" iteration syntax is error:
> "for(i=1;i<10;i++)"
> 
> But I don't know how to write it correctly!

This is why I suggested that you experiment in your U-Boot console,
where you can quickly try things. One thing I'd test first is whether
your C-like use of 'for' is valid at all for Hush, or for Bourne shell
(from which Hush derives IIUC) -- I suspect it might not be.

> Best wishes,

Amicalement,
-- 
Albert.

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

* [U-Boot] [U-boot] shell script syntax
  2013-07-22 11:44       ` TigerLiu at viatech.com.cn
  2013-07-22 12:05         ` Albert ARIBAUD
@ 2013-07-22 13:10         ` James Chargin
  2013-07-25  5:16           ` TigerLiu at viatech.com.cn
  1 sibling, 1 reply; 8+ messages in thread
From: James Chargin @ 2013-07-22 13:10 UTC (permalink / raw)
  To: u-boot

Try something like

=> for i in a b c; do
 > echo $i
 > done
a
b
c
=>

Regards,
Jim

On 07/22/2013 04:44 AM, TigerLiu at viatech.com.cn wrote:
> Hi, Albert:
>> Did you try the commands live in your U-Boot console?
>> Did you make sure hush shell is enabled in your U-boot?
> I am sure I have enabled hush shell.
>
> I think "for" iteration syntax is error:
> "for(i=1;i<10;i++)"
>
> But I don't know how to write it correctly!
>
> Best wishes,
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

-- 
Jim Chargin
AJA Video Systems                       jimc at aja.com
(530) 271-3334                          http://www.aja.com

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

* [U-Boot] [U-boot] shell script syntax
  2013-07-22 13:10         ` James Chargin
@ 2013-07-25  5:16           ` TigerLiu at viatech.com.cn
  0 siblings, 0 replies; 8+ messages in thread
From: TigerLiu at viatech.com.cn @ 2013-07-25  5:16 UTC (permalink / raw)
  To: u-boot

Hi, James:
>Try something like
>=> for i in a b c; do
> > echo $i
> > done
>a
>b
>c
>=>

Your suggestion is right!
Thank you!

Best wishes,

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

end of thread, other threads:[~2013-07-25  5:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-22  9:46 [U-Boot] [U-boot] shell script syntax TigerLiu at viatech.com.cn
2013-07-22 10:24 ` Albert ARIBAUD
2013-07-22 11:06   ` TigerLiu at viatech.com.cn
2013-07-22 11:29     ` Albert ARIBAUD
2013-07-22 11:44       ` TigerLiu at viatech.com.cn
2013-07-22 12:05         ` Albert ARIBAUD
2013-07-22 13:10         ` James Chargin
2013-07-25  5:16           ` TigerLiu at viatech.com.cn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.