Table of Contents

OPERATORS: Bash Bitwise Operators

 

Bitwise Operators

Bitwise Operators
 Operator Symbol Meaning
<< Bitwise Left Shift
>> Bitwise Right Shift
& Bitwise AND
| Bitwise OR
~ Bitwise Negate
^ Bitwise XOR

 

 

Examples
 a=4

let b=”$a<<1″

echo $b

8

b=8

c=4

echo $(($c|$d))

12

echo $((0xc^0x3))

15

 

Bash Bitwise Operators example
Bash Bitwise Operators example