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;








5















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?










share|improve this question
























  • 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 run xxd remotely.

    – Kusalananda
    6 hours ago












  • What shell are you using on the dragino machine?

    – icarus
    6 hours ago

















5















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?










share|improve this question
























  • 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 run xxd remotely.

    – Kusalananda
    6 hours ago












  • What shell are you using on the dragino machine?

    – icarus
    6 hours ago













5












5








5








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?










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 8 hours ago









Greg BellGreg Bell

3373 silver badges11 bronze badges




3373 silver badges11 bronze badges















  • 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 run xxd remotely.

    – 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












  • 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 run xxd remotely.

    – 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










2 Answers
2






active

oldest

votes


















7














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






share|improve this answer

























  • 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



















-1














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.






share|improve this answer




















  • 1





    You're thinking of the -t option. The -T does the opposite, explicitly disables pseudo-terminal allocation.

    – Kusalananda
    5 hours ago













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
);



);













draft saved

draft discarded


















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









7














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






share|improve this answer

























  • 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
















7














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






share|improve this answer

























  • 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














7












7








7







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






share|improve this answer













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







share|improve this answer












share|improve this answer



share|improve this answer










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


















  • 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














-1














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.






share|improve this answer




















  • 1





    You're thinking of the -t option. The -T does the opposite, explicitly disables pseudo-terminal allocation.

    – Kusalananda
    5 hours ago















-1














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.






share|improve this answer




















  • 1





    You're thinking of the -t option. The -T does the opposite, explicitly disables pseudo-terminal allocation.

    – Kusalananda
    5 hours ago













-1












-1








-1







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.






share|improve this answer













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.







share|improve this answer












share|improve this answer



share|improve this answer










answered 5 hours ago









Timothy BaldwinTimothy Baldwin

1935 bronze badges




1935 bronze badges










  • 1





    You're thinking of the -t option. The -T does the opposite, explicitly disables pseudo-terminal allocation.

    – Kusalananda
    5 hours ago












  • 1





    You're thinking of the -t option. The -T does 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

















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

François Viète Contents Biography Work and thought Bibliography See also Notes Further reading External links Navigation menup. 21Google Bookspp. 75–77Google BooksDe thou (from University of Saint Andrews)ArchivedGoogle BooksGoogle BooksGoogle BooksGoogle booksGoogle Bookscc-parthenay.frL'histoire universelle (fr)Universal History (en)ArchivedAdsabs.harvard.eduPagesperso-orange.frArchive.orgChikara Sasaki. Descartes' mathematical thought p.259Google BooksGoogle BooksGoogle Bookspp. 152 and onwardGoogle BooksGoogle BooksScribd.comGoogle Books1257-7979Google BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGallica.bnf.frGoogle BooksGoogle Books"François Viète"Francois Viète: Father of Modern Algebraic NotationThe Lawyer and the GamblerAbout TarporleySite de Jean-Paul GuichardL'algèbre nouvelle"About the Harmonicon"cb120511976(data)1188044800000 0001 0913 5903n82164680ola2013766880073431702w6vt1sb70287374827140948071409480