I am attempting to compare two strings containing hexadecimal numbers in a dash test, one which has leading zeros and one which doesn't:hex_string_1: 0x02a0000bhex_string_2: 0x2a0000bTrying if [ ${hex_string_1} -eq ${hex_string_2} ] ; then ... (or vice versa, the leading zeros don't seem to matter) gives me this error:[: Illegal number: 0x02a0000bIs there a simple way to compare these as numbers, rather than e.g. using sed to reformat the strings?Since I'm using dash and not bash,[[ isn't an option.UPDATE: This worked (thanks ott!):[ $(printf %d ${hex_string_1}) -eq $(printf %d ${hex_string_2}) ]
DASH hexadecimal string comparison
dash;hex