January 19th, 2012, 03:04 PM
Bitwise in Bash Scripting?
I'm trying to use bitwise in a bash script I'm writing, but it's producing some odd results
if I do an 'echo $((11000000 & 11111111))'
It returns with '10586304', which is not the integer, nor is it the binary result. What am I missing for bitwise operations in bash?
January 19th, 2012, 03:13 PM
Turns out it was a PEBKAC error.
Did not read up on the bitwise operator, just assumed it expected binary data. If I give in the proper integer, it works great lol.
Instead of $((11000000 & 11111111)), I should have used $((192 & 255))