X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org From: "Cutler, David" To: "cygwin AT cygwin DOT com" Date: Wed, 24 Oct 2007 01:06:58 +0000 Subject: RE: Bug in cat Message-ID: References: <471E9797 DOT 84584AF2 AT dessent DOT net> In-Reply-To: <471E9797.84584AF2@dessent.net> Accept-Language: en-US Content-Language: en-US acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 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 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id l9O17UIO009252 Hi Brian, It makes sense to me. I like your recommended replacement too. Thanks, -Dave -----Original Message----- From: Brian Dessent [mailto:brian AT dessent DOT net] Sent: Tuesday, October 23, 2007 5:54 PM To: Cutler, David Cc: bug-coreutils AT gnu DOT org Subject: Re: Bug in cat "Cutler, David" wrote: > When I downloaded Cygwin, I specified the use of DOS line terminators. > > I found a bug in what I suspect is cat when used with a simple bash shell script. Since you're using Cygwin, the Cygwin mailing list is a better place to post this because most coreutils developers don't use Cygwin. This is not technically a bug however, because cat always works in binary mode by design regardless of mount mode. This is required by POSIX I believe. Eric has mentioned in the past adding a Cygwin-specific --text option to cat but any time you start to maintain special patches it makes maintainer burden go up. Even then, you would have to give the option explicitly. And besides, there are much better ways to deal with this: > And you execute the command: > for I in `cat list` ; do echo \"${i}\" ; done Inefficient. Instead you can simply: while read i; do echo \"${i}\"; done