X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: David Menestrina Subject: Carriage-return problem with ssh, "hostname" command Date: Tue, 3 Jul 2007 22:21:36 +0000 (UTC) Lines: 52 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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/