X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: =?ISO-8859-1?Q?Ren=E9_Berber?= Subject: Re: 1.5.25-6: Win32 programs don't get correct >> redirection Date: Thu, 13 Dec 2007 20:10:00 -0600 Lines: 37 Message-ID: References: <4761DDA1 DOT 9050700 AT qualcomm DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) In-Reply-To: <4761DDA1.9050700@qualcomm.com> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 Jack Brennen wrote: > Running Cygwin version 1.5.25-6 with version 3.2.25-17 of bash with Win > XP Pro... >=20 > Start up bash. >=20 > Enter these commands in order: >=20 > sh-3.2$ echo ABCDEFGHIJKLMNOPQRST > foo.txt > sh-3.2$ echo UVWXYZ >> foo.txt > sh-3.2$ cat foo.txt > ABCDEFGHIJKLMNOPQRST > UVWXYZ > sh-3.2$ echo ABCDEFGHIJKLMNOPQRST > foo.txt > sh-3.2$ cmd /c echo UVWXYZ >> foo.txt > sh-3.2$ cat foo.txt > UVWXYZ > IJKLMNOPQRST [snip] What you don't see is that Windows' echo added a CR so you get to see the second line followed by CR-LF and the rest of the (overwritten) first line. You can delete the CR and get the correct output, for instance using: cmd /c echo UVWXYZ | tr -d "\r" >> foo.txt Or directly with something like: cmd /c echo UVWXYZ | tr -d "\r" | od -t x1z take out the translate part to see the CR-LF. --=20 Ren=E9 Berber -- 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/