1

My tool is wtiting binary chars to stdout and I can view it in hex with

# ./md /dev/ttyUSB0 | xxd
0000000: 6f03 1100 0003 0084 8400 0000 0900 0a00  o...............
0000010: 0008 0004 0000 0000 2c00 0000 0000 0000  ........,.......
...
00000b0: 8000 8000 8000 8000 8000 8000 8000 8000  ................
00000c0: 8047 ffff ff6f 04fd 2180 ff02 f700 f702  .G...o..!.......
00000d0: fbb6 00bf 10e1 a57f 4004 fb00 a780 7e00  ........@.

unfortunately, when I am trying to watch this screen

watch `./md /dev/ttyUSB0 | xxd`

watch `./md /dev/ttyUSB0 | hexdump`

It prints something like

enter image description here

either corrupting or misinterpretting output.

What do I do wrong?

1

Bacticks are used for command substitution, you need:

watch './md /dev/ttyUSB0 | xxd'
1
  • aaaaaaaaa! thanks! – Dims Nov 21 '20 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.