bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in cat 5.3.0 (cygwin) on XP SP2


From: Tristan Savatier
Subject: Re: bug in cat 5.3.0 (cygwin) on XP SP2
Date: Thu, 19 May 2005 12:44:58 -0700

in fact, i was wrong, the bug appears to be on our linux server, but it is
triggered when a file contains a DOS-type ^M character before a \n.

apparently when 'cat' encounters one ^M it goes in a mode where it adds ^M
before any \n, even if the original file did *not* have those.

weired.

i was expecting "cat file1 file2 file3" to just cat the files "as-is", not to add a character at the end of some lines of some files.

the bug is the same with less, more, etc, and i observed it on a very recent
and up-to-date linux box (not sure exactly what kernel, but it's a red-hat).

I can provide you some sample files that cause the problem.

It took me a while to find out because apparently, emacs does not display the ^M when it is at the end the last line of a file (I have such an example).

-t

----- Original Message ----- From: "Eric Blake" <address@hidden>
To: "Tristan Savatier" <address@hidden>
Cc: <address@hidden>
Sent: Thursday, May 19, 2005 5:33 AM
Subject: Re: bug in cat 5.3.0 (cygwin) on XP SP2


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Tristan Savatier on 5/18/2005 4:39 PM:
when 'cat' is passed several text files as parameters, it will add the
invisible control character '^M' at the end of each lines of each file
except the first file.

Cygwin line-ending problems should probably first be discussed on
cygwin<at>cygwin<dot>com.  Furthermore, it works just fine for me (I don't
think there is a bug, either in the cygwin distribution or upstream in
this list), it is probably a question of whether your files live on a text
mount, and whether they already had ^M's to begin with.  emacs has the
nice habit of suppressing ^M if EVERY line of the file has it (DOS mode),
but when only some lines have it (those lines from file2 and file3, but
not the lines from file1), you are in mixed mode and emacs reversts to
unix display.  Also, commands such as d2u are your friend when working
with mixed line ending machines.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCjIeM84KuGfSFAYARAqx2AJ4inZePYVIpSBu73KoM9URk/P3T4ACggogQ
6LD9dh+uA8+4jv3mXzWKyA8=
=VI57
-----END PGP SIGNATURE-----






reply via email to

[Prev in Thread] Current Thread [Next in Thread]