[U-Boot] [PATCH] common: cli_hush: Do a simple recursive variables parsing

Simon Glass sjg at chromium.org
Fri Dec 11 04:01:35 CET 2015


Hi Wolfgang,

On 6 December 2015 at 23:28, Wolfgang Denk <wd at denx.de> wrote:
> Dear Simon,
>
> In message <CAPnjgZ1j=yNOSbmDU0Pkq2y1wq-y=v7O2y7zPTNEfc==St3rgQ at mail.gmail.com> you wrote:
>>
>> > I think your change would causes non-standard shell behaviour.
>> >
>> > If you want to evaluate variables, you have to do so as part of a
>> > "run" command...
>>
>> I find the recursive behaviour much more useful. In particular we have
>> to jump through all sorts of hoops to build up a command line. It
>> would be much easier if we could make things recursive. The single
>> quote example above explicitly stops all substitution - do we need a
>> way to do that also?
>
> Useful it may be - in samoe cases at least, but I think it is a very
> bad idea to deviate from standard shell behaviour.

If you look at this patch [1]  you'll see the pain we have to go
through to make environment variables work. We have 'run regen_all'
which basically does what this patch already supports. It has to use
setenv to set up the variables after any of the variables in the
expressions change. And this is not so bad. It is much worse when you
try to use these sorts of things on the command line with setenv - in
fact I believe in some cases it is impossible to make the command line
do the right thing.

I'd really like to see recursive eval of environment variables. I
don't think of everything I enter in U-Boot being in single quotes.
Perhaps we should make this an option?

Regards,
Simon

[1] https://patchwork.ozlabs.org/patch/471911/


More information about the U-Boot mailing list