This really is a trivial code snippet, but as with most scripts it comes in handy because it simplifies even a basic task further. Save this to a simple filename like ‘hex2file’ and place it in your /usr/bin directory. Whenever you need to write out hex characters directly to a file use the following syntax.
hex2file 4142434445 > hexfile.bin
hexdump -C hexfile.bin
00000000 41 42 43 44 45 |ABCDE|
Here is the snippet.
Again, trivial – but useful!