[PATCH 0/3] add "call" command

Wolfgang Denk
2020-09-25T12:59:16Z

Dear Rasmus,

In message <20200925111942.4629-1-rasmus.villemoes@prevas.dk> you wrote:
> This adds a way to call a "function" defined in the environment with
> arguments. I.e., whereas
>
> run foo
>
> requires one to set the (shell or environment) variables referenced
> from foo beforehand, with this one can instead do
>
> call foo arg1 arg2 arg3
>
> and use $1... up to $9 in the definition of foo. $# is set so foo can
> make decisions based on that, and ${3:-default} works as expected.

This is definitely a useful idea.

But...

...the current version of hush in U-Boot is old, has a number of
known bugs and shortcomings, and I really recommend not to adding
any new features to it, because that would makie an update to a more
recent version even less likely.

So the first step before such extensions should be to update hush.
In that process (which might be more of a new port) one should
consider the possibility of keeping a little more of the
functionality - memory restrictins today are not so strict any more
as they were when hush was originally added. One feature that would
definitely be useful is command substitution.

All this needs a bit of a long term maintainable concept. Quick
hacking of the ancient code is not a good idea.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
God runs electromagnetics by wave theory on Monday, Wednesday, and
Friday, and the Devil runs them by quantum theory on Tuesday, Thurs-
day, and Saturday. -- William Bragg