From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerry Van Baren Date: Thu, 14 Feb 2008 07:41:37 -0500 Subject: [U-Boot-Users] [PATCH] Add setexpr command In-Reply-To: References: <20080213230715.420B8243A7@gemini.denx.de> Message-ID: <47B43701.1070102@ge.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Kumar Gala wrote: > On Feb 13, 2008, at 5:07 PM, Wolfgang Denk wrote: > >> In message > 4.64.0802131648030.23661 at blarg.am.freescale.net> you wrote: >>> Add a simple expr style command that will set an env variable as >>> the result >>> of the command. This allows us to do simple math in shell. The >>> following >>> operations are supported: &, |, ^, +, -, *, /. >>> >>> Signed-off-by: Kumar Gala >>> --- >>> >>> this was the expr patch, but renamed based on comments on the list. >> >> Well, *my* command was *not* to rename it. > > sorry, saw your post after I sent this :) >> >> >> At least, please don't make it a default command, then. > > If you are good with calling it expr so am I. I'd prefer not > confusing 'setenv' with 'setexpr'. If we call it expr add it to the > default list? > > - k OK, time to educate Jerry since I'm too lazy to check myself. Does our hush shell support back ticks? If we have back tick support, or can add that support, we should call it expr and return a value which then gets placed properly. That would be IDEAL. setenv foo `expr 2 + 3` gvb