From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18194 invoked by alias); 13 Feb 2017 19:07:40 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 18186 invoked by uid 89); 13 Feb 2017 19:07:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Kenneth, kenneth, conduent, Conduent X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 13 Feb 2017 19:07:29 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C6AFB61D28 for ; Mon, 13 Feb 2017 19:07:29 +0000 (UTC) Received: from [10.10.123.249] (ovpn-123-249.rdu2.redhat.com [10.10.123.249] (may be forged)) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1DJ7Scm012791 for ; Mon, 13 Feb 2017 14:07:29 -0500 Subject: Re: [ANNOUNCEMENT] Updated [test]: sed-4.4-1 To: cygwin@cygwin.com References: <58a07b9b.085fca0a.8af3f.103c@mx.google.com> <0D835E9B9CD07F40A48423F80D3B5A704BBE5793@USA7109MB022.na.xerox.net> <468737ff-2ca2-f65a-89a1-a4b166567f54@gmail.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Message-ID: Date: Mon, 13 Feb 2017 19:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <468737ff-2ca2-f65a-89a1-a4b166567f54@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7LJWkWNNPHivR0DejeFiWfSkdv4skQA11" X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00174.txt.bz2 --7LJWkWNNPHivR0DejeFiWfSkdv4skQA11 Content-Type: multipart/mixed; boundary="RIe3FVRUjqLwbidJ1bwTOhNwmxAMNCpDJ"; protected-headers="v1" From: Eric Blake To: cygwin@cygwin.com Message-ID: Subject: Re: [ANNOUNCEMENT] Updated [test]: sed-4.4-1 References: <58a07b9b.085fca0a.8af3f.103c@mx.google.com> <0D835E9B9CD07F40A48423F80D3B5A704BBE5793@USA7109MB022.na.xerox.net> <468737ff-2ca2-f65a-89a1-a4b166567f54@gmail.com> In-Reply-To: <468737ff-2ca2-f65a-89a1-a4b166567f54@gmail.com> --RIe3FVRUjqLwbidJ1bwTOhNwmxAMNCpDJ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 2051 On 02/13/2017 09:53 AM, cyg Simple wrote: > On 2/13/2017 9:14 AM, Nellis, Kenneth (Conduent) wrote: >> From: Steven Penny=20=20 >>> Perhaps I am missing something, but cant all that be said about Sed too= ? I >>> just cant see a situation where we are justified changing one and not t= he >>> other. They should either both strip carriage returns or neither. >> >> How about grep? >> >> $ printf 'hello\r\nworld\r\n' | grep hello | od -An -tcx1 >> h e l l o \n >> 68 65 6c 6c 6f 0a >> $ >> >> Are there others? >> >> (BTW, I support the change.) >> >=20 > All pipe handles should be binary or at least an option to make it that > way. The file handles should be bound to the mounted mode. I'm in favor of reducing special cases of FORCED text mode. It's great on text mounts, but text mounts are discouraged for a reason (slower computing, surprising results when seeking), and I recently patched bash to quit forcing text mode (bash 4.3.42-4). Pipes are indeed binary mode by default (and should stay that way), so even if you have a long pipeline chain: cmd1 < file_in | cmd2 | cmd3 | cmd4 > file_out if file_in and file_out are mounted on text mounts, then cmd1 won't see any carriage returns, so neither will cmd2, cmd3, or cmd4, and finally cmd4 writes in text mode back to file_out. But when you are operating on a binary mount, and WANT carriage returns to be preserved, forcing a text mount at any point in the chain corrupts all later points in the chain. There's a big difference between using "rt" to force text mode (which is what I killed in this sed release), using "rb" to force binary mode (which is what I use in tar, because tar MUST preserve binary data), and using "r" (which is what sed now uses) to let the mount point decide whether CR are important. So I'd be in favor of a patch to awk dropping forced text mode on binary mounts. And I'll look into fixing grep to quit misbehaving as well. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --RIe3FVRUjqLwbidJ1bwTOhNwmxAMNCpDJ-- --7LJWkWNNPHivR0DejeFiWfSkdv4skQA11 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 604 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJYogPvAAoJEKeha0olJ0NqVa0H/071IGfbb3iY1tIeLqCYWHjT F1hAjRiwSeIPi0EB8GNnUpmB9eU7iT+yaKnd98issyva++pspD8GUyImRYX07r/v z5Q9ljHUP09Ze78XZfiXLf/X85JhnL2PCUopmS0P4KSGINctBd7C3n8E8GioyoNC KbQ0vx89gI8Y9N1EG5hTVnVtlDs/tUrNlYgWW4WFz3tqIu3FKQ2ct2TLbwCRjwWY UcucyRZoBeda9HW1uTR27cN7FYaAwkN0i7/kP9QU9/ywtsPlHE8FsSI+O12bT44g 3Rh1Nr6okpb7tj+FaZwFRsdrCuesThhSE1pWm2Ho0W7vWhhdo/7MfqARK3/cD1A= =bjxc -----END PGP SIGNATURE----- --7LJWkWNNPHivR0DejeFiWfSkdv4skQA11--