Convert binary data to hexadecimal in a shell script

后端 未结 8 1502
日久生厌
日久生厌 2020-12-13 05:59

I want to convert binary data to hexadecimal, just that, no fancy formatting and all. hexdump seems too clever, and it \"overformats\" for me. I want to take x

8条回答
  •  醉梦人生
    2020-12-13 06:19

    dd + hexdump will also work:

    dd bs=1 count=1 if=/dev/urandom 2>/dev/null  | hexdump -e '"%x"'
    

提交回复
热议问题