public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Propagate Error Status to the Shell on fw_printenv Errors
Date: Wed, 07 May 2008 09:10:06 +0200	[thread overview]
Message-ID: <20080507071007.0818A2477F@gemini.denx.de> (raw)
In-Reply-To: Your message of "Wed, 07 May 2008 08:44:01 +0200." <87myn2ehqm.fsf@denx.de>

In message <87myn2ehqm.fsf@denx.de> you wrote:
> 
> > 	root at kilauea# fw_printenv -n hostname ipaddr
> > 	## Error: `-n' option requires exactly one argument
> > 	root at kilauea# echo $?
> > 	1
> 
> But I don't understand what the purpose of the "-n" option is?

The purpose seems clear to me - print the value of a variable without
the name. This can be useful in shell scripts, for example when you
want to do something like

	$ ipaddr=`fw_printenv -n ipaddr`

However, the addition of this feature is undocumented (not mentioned
in the commit message), and I don;t see why we should restrict it to a
single variable - it may be useful to print several values here, too,
for example like that:

	$ set `fw_printenv -n netdev ipaddr netmask`
	$ ifconfig $1 $2 netmask $3

[Well, I know that's a bad example because  it's  missing  all  error
checking, but you get the idea.]

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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
It is impractical for  the  standard  to  attempt  to  constrain  the
behavior  of code that does not obey the constraints of the standard.
                                                          - Doug Gwyn

  reply	other threads:[~2008-05-07  7:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-07  3:16 [U-Boot-Users] [PATCH] Propagate Error Status to the Shell on fw_printenv Errors Grant Erickson
2008-05-07  6:44 ` Markus Klotzbücher
2008-05-07  7:10   ` Wolfgang Denk [this message]
2008-05-07  7:32     ` Markus Klotzbücher
2008-05-07 13:53       ` Grant Erickson
2008-05-07 14:49         ` Markus Klotzbücher
2008-05-07 15:50         ` Wolfgang Denk
2008-05-07 13:56     ` Grant Erickson
2008-05-07 15:55       ` Wolfgang Denk
2008-05-07  7:29 ` Joakim Tjernlund
2008-05-07 14:01   ` Grant Erickson
2008-05-09 21:41 ` Wolfgang Denk

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=20080507071007.0818A2477F@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox