[U-Boot-Users] u-boot HUSH scripting using local variables.
Leonid
Leonid at a-k-a.net
Tue May 15 19:35:52 CEST 2007
On Tuesday, May 15, 2007 10:17 AM Wolfgang Denk wrote:
> > " In the current implementation, the local variables space and
global
> > environment variables space are separated. Local variables are those
you
> > define by simply typing like name=value. To access a local variable
> > later on, you have to write '$name' or '${name}'; to execute the
> > contents of a variable directly you can type '$name' at the command
> > prompt."
> >
> > ...which implies that local variables can be used to save commands
and
> > execute them later. It doesn't contradict with the statement in
previous
> > bullet that
> I don't see how you derive that. The text above does not mention
> commands or execution.
>From the passage: "...to execute the contents of a variable directly you
can type '$name' at the command prompt." I derive that local variable
content can be executed indeed and so it can be a command. What else can
it mean?
> > since it merely states that "run <command>" format is invalid for
local
> > variables, not that their execution itself is impossible.
> This is your interpretation, and it is wrong.
It could be of course; this is the very reason I ask experts' advice.
> "Only environment variables can be used with the ``run'' command"
means,
> that that cannot use local variables as arguments to the run command.
Well, now when you explicitly say so I do understand.
> > Same command, assigned using setenv is working:
> > U-Boot$ setenv sscr 'for ii in 1 2 3; do echo ii=$ii; done;'
> > U-Boot$ run sscr
> Yes, only "run" will correctly run command sequences.
Comment of such sort could be useful in the manual - it resolves all
ambiguities above.
> > Am I doing something wrong? U-boot version is 1.2.0 (official
release,
> > not top of the git tree).
> Yes, you are doing something wrong. So (somewhat intentionally, it
> seems) misinterpret the documentation.
I don't try to criticize u-boot or its documentation - they both are
great. And why should I have such evil intentions - what I can gain here
:-)? You may be assured that even if I misinterpreted the documentation
it was in good faith.
Best regards,
Leonid.
More information about the U-Boot
mailing list