I have a device in /var/iot/data
which I'm trying to get the data from remotely.
On the machine itself:
# cat /var/iot/data | xxd -ps -c 32
80de004a030270055678013ac591e5c6abac2185f4319c8088e3
That's the correct data.
If I run the same thing remotely, it looks correct:
$ ssh -T -x dragino 'cat /var/iot/data | xxd -ps -c 32'
80de004a030270055678013ac591e5c6abac2185f4319c8088e3
But it's actually coming through with a bunch of escape sequences:
$ ssh -T -x dragino 'cat /var/iot/data | xxd -ps -c 32' | xxd
00000000: 1b5d 3131 3b23 3138 3464 3666 0738 3064 .]11;#184d6f.80d
00000010: 6530 3034 6130 3330 3237 3030 3535 3637 e004a03027005567
00000020: 3830 3133 6163 3539 3165 3563 3661 6261 8013ac591e5c6aba
00000030: 6332 3138 3566 3433 3139 6338 3038 3865 c2185f4319c8088e
00000040: 330a 1b5d 3131 3b23 3139 3139 3730 07 3..]11;#191970.
What is all that .]11;#184d6f.
at the beginning?
echo
, it just adds the \n at the end and I had no idea why, in your case these are actually the control characters before and after, yet the #184d6f and #191970 makes me wonder why there's a hex color representation there, it's not something that bash usually works with. – Yaron Aug 14 '19 at 12:49ssh -T -x dragino 'cat /var/iot/data' | xxd -ps -c 32
? As far as I can see, there is no reason to runxxd
remotely. – Kusalananda Aug 14 '19 at 15:06