I am trying to recreate the format that hexdump -C will output, namely
00000000 50 4b 03 04 2d 00 04 00 08 00 16 b5 ea 56 99 f1 |PK..-........V..|
00000010 ef 29 ff ff ff ff ff ff ff ff 0f 00 30 00 6e 61 |.)..........0.na|
I'm arriving at something like
hexdump -n 200 -e '16/1 "%02x ""\t"" "' -e '"|"' -e '16/1 "%_p""|\n"' file.zip
giving
50 4b 03 04 2d 00 04 00 08 00 16 b5 ea 56 99 f1 |PK..-........V..|
ef 29 ff ff ff ff ff ff ff ff 0f 00 30 00 6e 61 |.)..........0.na|
but how do I add the extra space every 8 bytes and the offset in the file?
OK, found it: We can create groups by repeating format specifications inside the same
-eblock, and we output the offset with%10_ax.For double width (32 bytes), my whole commandline now looks like: