[PATCH] RFC: nvedit: support doing one (extra) expansion of the value in "env set"
Wolfgang Denk
wd at denx.de
Thu Feb 13 16:55:14 CET 2020
Dear Rasmus,
In message <f9aa247b-4b9b-9196-4de7-b352d25766fe at prevas.dk> you wrote:
>
> I'm sorry, I see I mistyped in my example above, it should have been
>
> if test $slot = "A" ; setenv result $BOOT_A_LEFT ...
>
> as should hopefully be clear from the original post and the eval
> examples. So to reiterate, the problem is to get the contents (or value,
> if you will) of the BOOT_A_LEFT variable into the result variable, not
> setting result to the string "BOOT_A_LEFT" - but with the wrinkle that
> BOOT_A_LEFT is generated programmatically, so the code cannot literally
> mention BOOT_A_LEFT anywhere.
Didn't I show this in my second, expanded example?
I suggest you provide a working example of shell code (say, bash, if
you like) to demonstrate what you really have in mind. It seems
I have problems understanding your verbal description.
> So just as print[env] takes the name of a variable and shows the
> name=value string, and one can thus say "printenv BOOT_${slot}_LEFT" as
> you did in your extended example, I could do
>
> env get result BOOT_${slot}_LEFT
>
> and get the value of the BOOT_${slot}_LEFT variable into result.
I still fail to see why you think this cannot be done with just the
already existing code. Just use setenv instead of printenv in my
example?
> Would you be ok with adding such an "env get" with less foot-gun potential?
I'm not OK with adding any special-purpose code which can easily
be implemented with existing scripting capabilites. And so far I
don't see the limitation you are running into.
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
Gewöhnlich glaubt der Mensch, wenn er nur Worte hört, es müsse sich
dabei doch auch was denken lassen. -- Goethe, Faust I
More information about the U-Boot
mailing list