X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=0.5 required=5.0	tests=AWL,BAYES_00,NIXSPAM_IXHASH,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;	charset="utf-8"
Subject: RE: sed strips CRs
Date: Mon, 13 Feb 2012 08:39:12 -0600
Message-ID: <2BF01EB27B56CC478AD6E5A0A28931F203F5655A@A1DAL1SWPES19MB.ams.acs-inc.net>
In-Reply-To: <CA+sc5m=C2=49c6grcLbwYz6rQNWux43m_oY9hvQGaGrh_guk_Q@mail.gmail.com>
References: <CA+sc5m=C2=49c6grcLbwYz6rQNWux43m_oY9hvQGaGrh_guk_Q@mail.gmail.com>
From: "Nellis, Kenneth" <Kenneth.Nellis@acs-inc.com>
To: <cygwin@cygwin.com>
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id q1DEdUiD023569

From: Earnie Boyd
>On Sat, Feb 11, 2012 at 12:56 PM, Corinna Vinschen wrote:>
>> That's why I wrote "on systems supporting this mode".  Sed input is
>> text input in the first place.  Therefore it's using textmode in the
>> first place.  This is done so for a long time.  If it's not what you
>> need, there's a workaround, the -b option.
>
> I was stressing the issue of the confusion.  That being, Cygwin is
> different than Linux as well as it is similar.  Many expect it to be
> exactly matching.

I agree that it's confusing. More confusion:
sed's man page does not mention the -b option, although sed --help does.
grep also strips CRs, but has option -U to suppress this behavior.
awk also strips CRs. I could not find an awk option to suppress this.
IMHO it would be preferable to replace this confusing state and align 
these tools with Cygwin's philosophy to work like GNU/Linux.

The standard response to issues dealing with CRLF files is to point the
user to dos2unix and text mode mounts. This should be adequate without
the hidden behavior of sed/grep/awk and probably others.

Respectfully submitted,
Ken Nellis

