- 论坛徽章:
- 145
|
本帖最后由 jason680 于 2017-04-13 07:16 编辑
回复 1# 杰大森
1. awk 4.x with -M
$ echo "ffffffff8121c9b0" "32d5" | awk 'function hex(n){return(strtonum("0x"n))}{printf("%x\n",hex($1)+hex($2))}'
ffffffff8121f800
$ echo "ffffffff8121c9b0" "32d5" | awk -M 'function hex(n){return(strtonum("0x"n))}{printf("%x\n",hex($1)+hex($2))}'
ffffffff8121fc85
2. bc utility with uppercase
$ echo "obase=16;ibase=16;" "FFFFFFFF8121C9B0 + 32D5" | bc
FFFFFFFF8121FC85
3. perl
$ echo "ffffffff8121c9b0 32d5" | perl -lane '{printf("%x\n", hex($F[0])+ hex($F[1]))}'
ffffffff8121fc85
|
|