Re: Set and clear bits in a bash script
On 23 September 2013 09:43, Ralf Mardorf <ralf.mardorf@alice-dsl.net> wrote:
> Hi,
>
> is there a way to set and clear bits of a byte in a bash script, by
> using "or" and "and" or has this to be done by an annoying workaround?
>
> I don't find an answer, when I search the Internet.
>
> Regards,
> Ralf
>
Hi Ralf,
Try this [1] method:
$let RE="5&1"
$echo $RE
1
$let RE="5>>1"
$echo $RE
2
My best!
Beco.
[1] from google keywords "bash script bitwise operations", second result.
http://my.safaribooksonline.com/book/operating-systems-and-server-administration/linux/0672326426/expressions/ch06lev1sec9
--
Dr Beco
A.I. researcher
"Sometimes the heart sees what is invisible to the eye." (H. Jackson Brown Jr.)
Reply to: