Check 7th bit is 1 with bash

I’m wondering if there’s a way to replace the if statement with something that checks whether $2 has the 7th bit set to 1?

cat $file | awk '{if ($2 == 87) print $1; else {}}' > out.txt"

For instance, 93 should print something whereas 128 should not.


Source: bash

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.