This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: 1.5.25-6: Win32 programs don't get correct >> redirection
- From: René Berber <r dot berber at computer dot org>
- To: cygwin at cygwin dot com
- Date: Thu, 13 Dec 2007 20:10:00 -0600
- Subject: Re: 1.5.25-6: Win32 programs don't get correct >> redirection
- References: <4761DDA1.9050700@qualcomm.com>
Jack Brennen wrote:
> Running Cygwin version 1.5.25-6 with version 3.2.25-17 of bash with Win
> XP Pro...
>
> Start up bash.
>
> Enter these commands in order:
>
> 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.
--
René 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/