I need to read hexadecimal data from stdin, convert it to binary, send with netcat
, recieve reply, convert back to hex and print to stdout. I do:
# xxd -r -p | nc -u localhost 12345 | xxd
Then type my data in hex and press Enter. But it is not sent untill I press Ctrl+D
, so I'm unable to sent another packet after receiving reply. Looks like xxd -r -p
doesn't write binary data, until EOF
is given. Is there a way to make it write after newline?