更新时间:2023-02-03 08:59:45
标准解决方案:
expr $d1 - $d2
您也可以这样做:
echo $(( d1 - d2 ))
,但是请注意,这会将07
视为八进制数字! (因此07
与7
相同,但010
与10
不同).
but beware that this will treat 07
as an octal number! (so 07
is the same as 7
, but 010
is different than 10
).