更新时间:2023-11-08 11:35:04
至少bash
直接支持十六进制整数,只要它们以0x
为前缀:
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...