From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus =?utf-8?Q?Klotzb=C3=BCcher?= Date: Wed, 07 May 2008 09:32:49 +0200 Subject: [U-Boot-Users] [PATCH] Propagate Error Status to the Shell on fw_printenv Errors In-Reply-To: <20080507071007.0818A2477F@gemini.denx.de> (Wolfgang Denk's message of "Wed\, 07 May 2008 09\:10\:06 +0200") References: <20080507071007.0818A2477F@gemini.denx.de> Message-ID: <87myn2vaam.fsf@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk writes: > 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` Oh right, yes. Shouldn't post to lists before drinking coffee in the morning. > 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.] Yes, that would nice indeed. Grant, care to add this? And please update the documentation in any case. Best regards Markus Klotzb?cher -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de