Using dd command to write bytes
I'm using
Code:
dd if=/dev/zero bs=5 count=1 of=binfile Code:
hexdump -b binfile How can I use dd to write bytes of 1 or 5 for example? hexdump -b will return 0000000 001 001 001 001 001 or 0000000 005 005 005 005 005 |
Maybe with something like this:
Code:
$ for i in {1..5}; do echo -n $'\x01'; done | dd of=binfile Code:
$ dd if=/dev/zero bs=5 count=1 | sed 's/\x00/\x01/g' > binfile |
Thank you very much.
I used the second option because I needed to add the bytes at the end of the file. Worked great! |
All times are GMT -5. The time now is 04:29 PM. |