using bash: write bit representation of integer to file

前端 未结 9 937
春和景丽
春和景丽 2020-12-15 20:30

I have a file with binary data and I need to replace a few bytes in a certain position. I\'ve come up with the following to direct bash to the offset and show me that it fou

9条回答
  •  太阳男子
    2020-12-15 21:06

    You can use echo to emit specific bytes using hex or octal. For example:

    echo -n -e \\x30 
    

    will print ascii 0 (0x30)

    (-n remove trailing newline)

提交回复
热议问题