At least bash
supports hexadecimal integers directly, provided that they are prefixed with 0x
:
$ [[ 0xdead -lt 0xcafe ]] && echo yes || echo no
no
$ [[ 0xdead -gt 0xcafe ]] && echo yes || echo no
yes
You just use the comparison operators normally...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…