Conversion Hex String Into Ascii In Bash Command Line
Answer : This worked for me. $ echo 54657374696e672031203220330 | xxd -r -p Testing 1 2 3$ -r tells it to convert hex to ascii as opposed to its normal mode of doing the opposite -p tells it to use a plain format. This code will convert the text 0xA7.0x9B.0x46.0x8D.0x1E.0x52.0xA7.0x9B.0x7B.0x31.0xD2 into a stream of 11 bytes with equivalent values. These bytes will be written to standard out. TESTDATA=$(echo '0xA7.0x9B.0x46.0x8D.0x1E.0x52.0xA7.0x9B.0x7B.0x31.0xD2' | tr '.' ' ') for c in $TESTDATA; do echo $c | xxd -r done As others have pointed out, this will not result in a printable ASCII string for the simple reason that the specified bytes are not ASCII. You need post more information about how you obtained this string for us to help you with that. How it works: xxd -r translates hexadecimal data to binary (like a reverse hexdump). xxd requires that each line start off with the index number of the first character on the line (run hexdump on som