grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC][PATCH] cmd: test: Add bitwise AND, document the feature


From: Brad Mouring
Subject: Re: [RFC][PATCH] cmd: test: Add bitwise AND, document the feature
Date: Mon, 17 Apr 2017 15:42:18 -0500
User-agent: Mutt/1.6.1 (2016-04-27)

On Thu, Apr 13, 2017 at 06:20:24AM +0300, Andrei Borzenkov wrote:
> 12.04.2017 21:10, Brad Mouring пишет:
> > Currently, there is not a good way to control script flow based on
> > bitwise values. This initially led to NI adding the ability to read
> > a specific bit from a port-mapped register to control bootflow.
> > 
> > Here, we add a more generic ability to test the bitwise AND of a
> > value available to the grub scripting environment. This obviates the
> > need for the inbit command (which is currently OOT).
> > 
> 
> See recent discussion about arithmetic operations. This could also be
> 
> if $((a&b)); then
>  ...
> fi
> 
> I think it is more generic than single specific test.

I can appreciate the sentiment, but are you asking me to implement
some/all of the functionality of the double-paren arith expansion,
partially duplicating the functionality of the test/[ command, simply
because (( a & b )) is more bash-ful than [ a -bwa b ]?

I'm not trying to bake-in any sort of assumption here, in fact, I'm
just trying to get clarification.

Thanks,
Brad



reply via email to

[Prev in Thread] Current Thread [Next in Thread]