Why does cat'ing a file via ssh result in control characters?Set up graphic interface (desktop) for remote connectionSSH - Only require google-authenticator from outside local networkWhy would SSH freeze for minutes at a time when other traffic is unaffected?Wake-on-LAN via SSHHow do I reboot over a ssh connection without a return code of -1?SSH speed greatly improved via ProxyCommand - but why?Machine does not serve non-localhost clients, SSH worksHow can I check the model of a device connected to a specific COM through a ssh connection
What unique challenges/limitations will I face if I start a career as a pilot at 45 years old?
When did Bilbo and Frodo learn that Gandalf was a Maia?
"Table of Astronomy's" depiction of the solar system models
Carry-on liquids in toiletry bag (not clear ziplock)?
Chunk + Enumerate a list of digits
Are there really no countries that protect Freedom of Speech as the United States does?
Transition to "Starvation Mode" in Survival Situations
NRPE script for monitoring load average
What can Amex do if I cancel their card after using the sign up bonus miles?
Should I email my professor about a recommendation letter if he has offered me a job?
Telephone number in spoken words
Scam? Phone call from "Department of Social Security" asking me to call back
An array battle with odd secret powers
Would the USA be eligible to join the European Union?
Does an Irish VISA WARNING count as "refused entry at the border of any country other than the UK?"
Does an object storing more internal energy emit more thermal radiation?
What would it take to get a message to another star?
Installing Windows to flash UEFI/ BIOS, then reinstalling Ubuntu
Escape Velocity - Won't the orbital path just become larger with higher initial velocity?
How much can I judge a company based on a phone screening?
How to remove ambiguity: "... lives in the city of H, the capital of the province of NS, WHERE the unemployment rate is ..."?
How do I call a 6-digit Australian phone number with a US-based mobile phone?
Dogfights in outer space
What kind of liquid can be seen 'leaking' from the upper surface of the wing of a Boeing 737-800?
Why does cat'ing a file via ssh result in control characters?
Set up graphic interface (desktop) for remote connectionSSH - Only require google-authenticator from outside local networkWhy would SSH freeze for minutes at a time when other traffic is unaffected?Wake-on-LAN via SSHHow do I reboot over a ssh connection without a return code of -1?SSH speed greatly improved via ProxyCommand - but why?Machine does not serve non-localhost clients, SSH worksHow can I check the model of a device connected to a specific COM through a ssh connection
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
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?
shell ssh terminal
add a comment |
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?
shell ssh terminal
I've had this exact problem withecho, 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
8 hours ago
Related but not an answer: serverfault.com/a/746638/237978
– Greg Bell
8 hours ago
2
Do you have a .bashrc on the remote server? That may be generating those strings. What does `ssh -T -x dragino 'cat /dev/null' | xxd show?
– wurtel
7 hours ago
The two commands are not equivalent. Could you also tryssh -T -x dragino 'cat /var/iot/data' | xxd -ps -c 32? As far as I can see, there is no reason to runxxdremotely.
– Kusalananda♦
6 hours ago
What shell are you using on the dragino machine?
– icarus
6 hours ago
add a comment |
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?
shell ssh terminal
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?
shell ssh terminal
shell ssh terminal
asked 8 hours ago
Greg BellGreg Bell
3373 silver badges11 bronze badges
3373 silver badges11 bronze badges
I've had this exact problem withecho, 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
8 hours ago
Related but not an answer: serverfault.com/a/746638/237978
– Greg Bell
8 hours ago
2
Do you have a .bashrc on the remote server? That may be generating those strings. What does `ssh -T -x dragino 'cat /dev/null' | xxd show?
– wurtel
7 hours ago
The two commands are not equivalent. Could you also tryssh -T -x dragino 'cat /var/iot/data' | xxd -ps -c 32? As far as I can see, there is no reason to runxxdremotely.
– Kusalananda♦
6 hours ago
What shell are you using on the dragino machine?
– icarus
6 hours ago
add a comment |
I've had this exact problem withecho, 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
8 hours ago
Related but not an answer: serverfault.com/a/746638/237978
– Greg Bell
8 hours ago
2
Do you have a .bashrc on the remote server? That may be generating those strings. What does `ssh -T -x dragino 'cat /dev/null' | xxd show?
– wurtel
7 hours ago
The two commands are not equivalent. Could you also tryssh -T -x dragino 'cat /var/iot/data' | xxd -ps -c 32? As far as I can see, there is no reason to runxxdremotely.
– Kusalananda♦
6 hours ago
What shell are you using on the dragino machine?
– icarus
6 hours ago
I've had this exact problem with
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
8 hours ago
I've had this exact problem with
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
8 hours ago
Related but not an answer: serverfault.com/a/746638/237978
– Greg Bell
8 hours ago
Related but not an answer: serverfault.com/a/746638/237978
– Greg Bell
8 hours ago
2
2
Do you have a .bashrc on the remote server? That may be generating those strings. What does `ssh -T -x dragino 'cat /dev/null' | xxd show?
– wurtel
7 hours ago
Do you have a .bashrc on the remote server? That may be generating those strings. What does `ssh -T -x dragino 'cat /dev/null' | xxd show?
– wurtel
7 hours ago
The two commands are not equivalent. Could you also try
ssh -T -x dragino 'cat /var/iot/data' | xxd -ps -c 32 ? As far as I can see, there is no reason to run xxd remotely.– Kusalananda♦
6 hours ago
The two commands are not equivalent. Could you also try
ssh -T -x dragino 'cat /var/iot/data' | xxd -ps -c 32 ? As far as I can see, there is no reason to run xxd remotely.– Kusalananda♦
6 hours ago
What shell are you using on the dragino machine?
– icarus
6 hours ago
What shell are you using on the dragino machine?
– icarus
6 hours ago
add a comment |
2 Answers
2
active
oldest
votes
The sequences are
OSC 1 1 ; # 1 8 4 d 6 f BEL
OSC 1 1 ; # 1 9 1 9 7 0 BEL
which is are xterm control sequences to request to set the terminal text background color. Probably caused by a badly written shell initialization file which causes these to be output in an attempt to distinguish the output of commands from the shell prompt, but does so unconditionally
This was it. My fault. Smoking shoe award. I've setup ssh to change my terminal background so I'm always reminded that I'm on a remote machine. Stupid! Will delete the question. Thanks for this decoding Icarus - it's what made the lightbulb turn on.
– Greg Bell
48 mins ago
add a comment |
The -T option for ssh will cause the remote SSH server to allocate a virtual terminal for the session and therefore programs (such as the shell) will act accordingly.
For transferring arbitrary data omit the -T option.
1
You're thinking of the-toption. The-Tdoes the opposite, explicitly disables pseudo-terminal allocation.
– Kusalananda♦
5 hours ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535558%2fwhy-does-cating-a-file-via-ssh-result-in-control-characters%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The sequences are
OSC 1 1 ; # 1 8 4 d 6 f BEL
OSC 1 1 ; # 1 9 1 9 7 0 BEL
which is are xterm control sequences to request to set the terminal text background color. Probably caused by a badly written shell initialization file which causes these to be output in an attempt to distinguish the output of commands from the shell prompt, but does so unconditionally
This was it. My fault. Smoking shoe award. I've setup ssh to change my terminal background so I'm always reminded that I'm on a remote machine. Stupid! Will delete the question. Thanks for this decoding Icarus - it's what made the lightbulb turn on.
– Greg Bell
48 mins ago
add a comment |
The sequences are
OSC 1 1 ; # 1 8 4 d 6 f BEL
OSC 1 1 ; # 1 9 1 9 7 0 BEL
which is are xterm control sequences to request to set the terminal text background color. Probably caused by a badly written shell initialization file which causes these to be output in an attempt to distinguish the output of commands from the shell prompt, but does so unconditionally
This was it. My fault. Smoking shoe award. I've setup ssh to change my terminal background so I'm always reminded that I'm on a remote machine. Stupid! Will delete the question. Thanks for this decoding Icarus - it's what made the lightbulb turn on.
– Greg Bell
48 mins ago
add a comment |
The sequences are
OSC 1 1 ; # 1 8 4 d 6 f BEL
OSC 1 1 ; # 1 9 1 9 7 0 BEL
which is are xterm control sequences to request to set the terminal text background color. Probably caused by a badly written shell initialization file which causes these to be output in an attempt to distinguish the output of commands from the shell prompt, but does so unconditionally
The sequences are
OSC 1 1 ; # 1 8 4 d 6 f BEL
OSC 1 1 ; # 1 9 1 9 7 0 BEL
which is are xterm control sequences to request to set the terminal text background color. Probably caused by a badly written shell initialization file which causes these to be output in an attempt to distinguish the output of commands from the shell prompt, but does so unconditionally
answered 7 hours ago
icarusicarus
7,3981 gold badge17 silver badges33 bronze badges
7,3981 gold badge17 silver badges33 bronze badges
This was it. My fault. Smoking shoe award. I've setup ssh to change my terminal background so I'm always reminded that I'm on a remote machine. Stupid! Will delete the question. Thanks for this decoding Icarus - it's what made the lightbulb turn on.
– Greg Bell
48 mins ago
add a comment |
This was it. My fault. Smoking shoe award. I've setup ssh to change my terminal background so I'm always reminded that I'm on a remote machine. Stupid! Will delete the question. Thanks for this decoding Icarus - it's what made the lightbulb turn on.
– Greg Bell
48 mins ago
This was it. My fault. Smoking shoe award. I've setup ssh to change my terminal background so I'm always reminded that I'm on a remote machine. Stupid! Will delete the question. Thanks for this decoding Icarus - it's what made the lightbulb turn on.
– Greg Bell
48 mins ago
This was it. My fault. Smoking shoe award. I've setup ssh to change my terminal background so I'm always reminded that I'm on a remote machine. Stupid! Will delete the question. Thanks for this decoding Icarus - it's what made the lightbulb turn on.
– Greg Bell
48 mins ago
add a comment |
The -T option for ssh will cause the remote SSH server to allocate a virtual terminal for the session and therefore programs (such as the shell) will act accordingly.
For transferring arbitrary data omit the -T option.
1
You're thinking of the-toption. The-Tdoes the opposite, explicitly disables pseudo-terminal allocation.
– Kusalananda♦
5 hours ago
add a comment |
The -T option for ssh will cause the remote SSH server to allocate a virtual terminal for the session and therefore programs (such as the shell) will act accordingly.
For transferring arbitrary data omit the -T option.
1
You're thinking of the-toption. The-Tdoes the opposite, explicitly disables pseudo-terminal allocation.
– Kusalananda♦
5 hours ago
add a comment |
The -T option for ssh will cause the remote SSH server to allocate a virtual terminal for the session and therefore programs (such as the shell) will act accordingly.
For transferring arbitrary data omit the -T option.
The -T option for ssh will cause the remote SSH server to allocate a virtual terminal for the session and therefore programs (such as the shell) will act accordingly.
For transferring arbitrary data omit the -T option.
answered 5 hours ago
Timothy BaldwinTimothy Baldwin
1935 bronze badges
1935 bronze badges
1
You're thinking of the-toption. The-Tdoes the opposite, explicitly disables pseudo-terminal allocation.
– Kusalananda♦
5 hours ago
add a comment |
1
You're thinking of the-toption. The-Tdoes the opposite, explicitly disables pseudo-terminal allocation.
– Kusalananda♦
5 hours ago
1
1
You're thinking of the
-t option. The -T does the opposite, explicitly disables pseudo-terminal allocation.– Kusalananda♦
5 hours ago
You're thinking of the
-t option. The -T does the opposite, explicitly disables pseudo-terminal allocation.– Kusalananda♦
5 hours ago
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535558%2fwhy-does-cating-a-file-via-ssh-result-in-control-characters%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I've had this exact problem with
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
8 hours ago
Related but not an answer: serverfault.com/a/746638/237978
– Greg Bell
8 hours ago
2
Do you have a .bashrc on the remote server? That may be generating those strings. What does `ssh -T -x dragino 'cat /dev/null' | xxd show?
– wurtel
7 hours ago
The two commands are not equivalent. Could you also try
ssh -T -x dragino 'cat /var/iot/data' | xxd -ps -c 32? As far as I can see, there is no reason to runxxdremotely.– Kusalananda♦
6 hours ago
What shell are you using on the dragino machine?
– icarus
6 hours ago