All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH] RFC: nvedit: support doing one (extra) expansion of the value in "env set"
Date: Thu, 13 Feb 2020 16:55:14 +0100	[thread overview]
Message-ID: <20200213155514.C4DA1240057@gemini.denx.de> (raw)
In-Reply-To: <f9aa247b-4b9b-9196-4de7-b352d25766fe@prevas.dk>

Dear Rasmus,

In message <f9aa247b-4b9b-9196-4de7-b352d25766fe@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

  reply	other threads:[~2020-02-13 15:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05  1:08 [PATCH] RFC: nvedit: support doing one (extra) expansion of the value in "env set" Rasmus Villemoes
2020-02-05 17:59 ` Simon Glass
2020-02-11 15:38   ` Rasmus Villemoes
2020-02-11 17:14     ` Simon Glass
2020-02-11 16:30 ` Wolfgang Denk
2020-02-11 21:20   ` Rasmus Villemoes
2020-02-11 21:34     ` Rasmus Villemoes
2020-02-12 11:45       ` Wolfgang Denk
2020-02-12 11:38     ` Wolfgang Denk
2020-02-13 10:41       ` Rasmus Villemoes
2020-02-13 15:55         ` Wolfgang Denk [this message]
2020-02-14 11:54           ` Rasmus Villemoes
2020-02-14 12:23             ` Rasmus Villemoes
2020-02-14 12:35             ` Martin Hundebøll
2020-02-16 15:33               ` Wolfgang Denk
2020-02-16 15:24             ` Wolfgang Denk
2020-02-16 17:25               ` Wolfgang Denk
2020-02-18  8:11                 ` Rasmus Villemoes
2020-02-21 23:32                   ` Rasmus Villemoes
2020-02-22  0:54                     ` Tom Rini
2023-02-02 15:15             ` Rasmus Villemoes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200213155514.C4DA1240057@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.