This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Carriage-return problem with ssh, "hostname" command


Hi,

I have a strange problem with carriage-return (CR, \r, ^M) handling on Cygwin
(DLL version: 1.5.24).  The problem is only exposed when running the "hostname"
command via ssh.  Here is a sample session that demonstrates the bug:

----------------------
$ hostname | cat -v
myhost
----------------------

This is the expected output.

----------------------
$ ssh localhost
Last login: Tue Jul  3 14:47:22 2007 from localhost
$ hostname | cat -v
myhost
$ exit
logout
Connection to localhost closed.
----------------------

Again, this is the expected output.

----------------------
$ ssh localhost 'hostname | cat -v'
myhost^M
----------------------

For some reason, there is now a carriage-return character at the end of the
result.  Note that "hostname" is the *only* command I've found that has this
problem:

----------------------
$ ssh localhost 'echo hello | cat -v'
hello
$ ssh localhost 'whoami | cat -v'
myuser
----------------------

I have tried various combinations of stty, setting the TERM variable, setting
the CYGWIN variable (binmode? tty?), and using ssh -t, but I haven't found a
solution, and I'm just grasping at straws.  When I first installed the ssh
server, I told it to use the CYGWIN variable "ntsec tty", if that matters.

Does anyone have an idea for solving this problem?

Thanks,
david

You can see that executing 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]