#!/bin/sh
test="2"
if [ "$((test & 0x1))" != 0 ]; then
echo "First bit is set"
else
echo "First bit is not set"
fi
In this example, if statement contains double quotes and compared against an integer, this works well. But is this correct? Are double quotes right here? Works well even without the double quotes.