[U-Boot-Users] [PATCH] Add setexpr command

Kumar Gala galak at kernel.crashing.org
Thu Feb 14 15:35:50 CET 2008


On Feb 14, 2008, at 6:41 AM, Jerry Van Baren wrote:

> Kumar Gala wrote:
>> On Feb 13, 2008, at 5:07 PM, Wolfgang Denk wrote:
>>> In message <Pine.LNX. 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 <galak at kernel.crashing.org>
>>>> ---
>>>>
>>>> this was the expr patch, but renamed based on comments on the list.
>>> <grumble>
>>> Well, *my* command was *not* to rename it.
>> sorry, saw your post after I sent this :)
>>> </grumble>
>>>
>>> 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`

no we dont' support back ticks like this.

- k




More information about the U-Boot mailing list