Extra space after the colon in the address causes xxd -r to produce empty/invalid output
Example 1:
echo '00000000: 4D5A4950 00000001 60080000 00000001 MZIP .... `... ....' | xxd -r > test
sum test
00000 0
Workaround/correct result
echo '00000000: 4D5A4950 00000001 60080000 00000001 MZIP .... `... ....' | tr -s ' ' | xxd -r > test
sum test
59979 1 # correct
Example 2: any file
xxd file1| sed 's/: /: /' | xxd -r > file2
cmp file1 file2
cmp: EOF on file2 which is empty
xxd -r should ignore extra whitespace between the colon and hex dump and produce correct output
xxd 2022-01-14 / vim 8.2.5044
Linux xxd V1.10 27oct98 through xxd 2022-01-14
Cygwin xxd 2022-01-14
No response
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
How did that extra space get there?
"xxd -r" is really only for reversing the output of xxd itself. It's not a generic hex-dump-to-binary conversion tool.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
It was a memory dump from an embedded system, it was the only way to transfer off the device.
" It's not a generic hex-dump-to-binary conversion tool." - good to know
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()