下列的在 UNIX shell 脚本中将十进制转换为十六进制 https://stackoverflow.com/questions/378829/convert-decimal-to-hexadecimal-in-unix-shell-script
我试图只打印hex values
from hexdump
,即不打印行号和 ASCII 表。
但以下命令行不会打印任何内容:
hexdump -n 50 -Cs 10 file.bin | awk '{for(i=NF-17; i>2; --i) print $i}'
Using xxd
更适合这项工作:
xxd -p -l 50 -seek 10 file.bin
From man xxd https://linux.die.net/man/1/xxd:
xxd - make a hexdump or do the reverse.
-p | -ps | -postscript | -plain
output in postscript continuous hexdump style. Also known as plain hexdump style.
-l len | -len len
stop after writing <len> octets.
-seek offset
When used after -r: revert with <offset> added to file positions found in hexdump.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)