delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/02/13/09:39:34

X-Recipient: archive-cygwin AT delorie DOT 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
MIME-Version: 1.0
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 AT mail DOT gmail DOT com>
From: "Nellis, Kenneth" <Kenneth DOT Nellis AT acs-inc DOT com>
To: <cygwin AT cygwin DOT com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019