richard richard.lewis@uea.ac.uk wrote:
Hello ALUG list,
Does anyone know to use the hexdump program?
I've been trying all night (and am at serious risk of fatal caffeine poisoning!)
All I want it to do is print every byte of a file in hex notation without any other rubbish (no indexes, no ASCII, no spaces, no line feeds, no nothing).
It claims that you can pass it a format string in the same format as fprintf() so I tried this: $ hexdump -e "%x" {filename} >{outputfile}
but it just said that my format string was a "bad format {%x}".
OK - having just played with it for the last 5 mins to see what I could find out... I've got the following...
hexdump -e '16/1 "%02x" "\n"' filename
16/1 means take sixteen single byte values per line... and %02x means format them as 0 padded 2 digit hex format output
(so, 32 chars wide, then :)
Everyone else seems to have suggested perl, *SIGH* why not use the tool thats designed for the job <G>
Cheers,
Brett