How to compare hexadecimal number with hexadecimal numbers in shell?
At least bash supports hexadecimal integers directly, provided that they are prefixed with 0x:
bash
0x
$ [[ 0xdead -lt 0xcafe ]] && echo yes || echo no no $ [[ 0xdead -gt 0xcafe ]] && echo yes || echo no yes
You just use the comparison operators normally...
548k questions
547k answers
4 comments
86.3k users