February 2009 Archives

Getting hexdump to Give Suitable Output for Use in C

| No Comments

Here’s how to get hexdump to give you a suitable output for embedding in a C file:

hexdump -e "8/1 \"0x%02x, \" \"\n\"" <file>

(This post is for my benefit as much as anyone else.)