bug-coreutils
[Top][All Lists]
Advanced

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

Re: Bug in cat


From: Eric Blake
Subject: Re: Bug in cat
Date: Tue, 23 Oct 2007 18:56:14 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666

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

According to Cutler, David on 10/23/2007 6:16 PM:
> 
> Note that the end quote is missing from the echo statement of the loop 
> iterator.

Not necessarily a bug.  What is really happening is that on cygwin, cat
ALWAYS operates in binary mode (because it can concatenate binary files
together, and you don't want cat to corrupt those).  Therefore, cat is
literally outputting the carriage return from your text file, which, when
displayed on the terminal, changes where the end quote displays.

At one point in the past, cat used to have a --binary option; however, it
was removed in 5.90, because binary mode should always be the default
according to POSIX.  Unfortunately, it was not replaced with a --text
mode, to specify non-default behavior of not forcing binary mode on text
files, and I haven't been bothered enough by it to write a patch (when I
use cygwin, I always use binary mode mounts, as there are just too many
gotchas, in too many tools besides cat, for text mode to be useful).

> 
> If you replace cat with more, the script works as expected.

Because more does not always use binary mode.  But that is besides the
point, since more is not a coreutil.

By the way, text vs. binary issues on cygwin are probably better discussed
on the cygwin mailing list, cygwin AT cygwin DOT com.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
volunteer coreutils port maintainer for cygwin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHHpgu84KuGfSFAYARAhRHAJ9tKVAlASRGow34YSBHdotKNSqEEACeMOCX
mqrGlrvZNW+KWIv6yyuqlds=
=/I4L
-----END PGP SIGNATURE-----




reply via email to

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