delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/02/12/06:32:44

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=auCQ7WRK5lwTrOLUwKcnWYdNplcMNyGVmsdOrd2ZTl5SOR5Ks4SQx
cmvQ5nPXhOo9bBPURQBKmJmX77VUyD3BMxsmQ/1po/rX5VrZMtuTKPnma5j3Wf1O
YE2ePJiKuHA7hUyRMaaFBNARzK3OA6ZcW2fQVIfLUeYWRxMiIfaBBY=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=WRhH0NSiF1CKQ7CJkAmaJhbjpKY=; b=aO/km7Lkiw3yBIRdXSiCyHoRnx3K
ckx4ld3cjTzHPr9MSaEWruCY56crkfE9f04MYVxKuP0I2yfMzw1BI5MY2KTt3Afg
rqt5cfEIlgr0p3ruX7UxYKicDwWFKxdfptUycnnPplQmsD5NZ2/sPRIQqJ8MjVhV
CvW9yVm2tieHBaw=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-101.6 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=
X-HELO: drew.franken.de
Date: Sun, 12 Feb 2017 12:32:22 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: [ANNOUNCEMENT] Updated [test]: sed-4.4-1
Message-ID: <20170212113222.GF11666@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <announce DOT fef1110c-ac22-0877-6602-ae7f0acb7e54 AT redhat DOT com> <589f97c1 DOT 1c139d0a DOT 60fe5 DOT 98e2 AT mx DOT google DOT com>
MIME-Version: 1.0
In-Reply-To: <589f97c1.1c139d0a.60fe5.98e2@mx.google.com>
User-Agent: Mutt/1.7.1 (2016-10-04)

--F8dlzb82+Fcn6AgP
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Feb 11 15:01, Steven Penny wrote:
> On Sat, 11 Feb 2017 11:06:17, "Eric Blake (cygwin)" wrote:
> > I made a tweak that no longer automatically strips carriage returns from
> > input on binary mounts
>=20
> This is great, but can we do it for Awk too?
>=20
>     $ printf 'hello world\r\n' | awk 1 | od -tcx1
>     0000000   h   e   l   l   o       w   o   r   l   d  \n
>              68  65  6c  6c  6f  20  77  6f  72  6c  64  0a
>=20
> Currently you have to make this awful incantation:
>=20
>     $ unset POSIXLY_CORRECT
>     $ printf 'hello world\r\n' | awk -vBINMODE=3D1 1 | od -tcx1
>     0000000   h   e   l   l   o       w   o   r   l   d  \r  \n
>              68  65  6c  6c  6f  20  77  6f  72  6c  64  0d  0a
>=20
> BINMODE only gets parsed on the command line; it is not recognized even i=
n the
> BEGIN section. This makes it impossible to write portable Awk scripts with
> respect to carriage returns.

I understand the desire but it's s a pretty tricky problem.  awk is
used to manipulate text input in the first place so it treats all
input, files as well as stdin, as text.  So, shall we drop this
behaviour for files only?  Or for stdin as well?  How many existing
setups are bound to fail after a change?


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--F8dlzb82+Fcn6AgP
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJYoEfFAAoJEPU2Bp2uRE+gRd4P/iFI/ZsHCpZa1zg8Z8dChHZM
n0QykqCsPXEO4V7MQcfbUOybAJe6xCpMCoaz8jpqlpbbcZzNdwRyDv5Zt9mdx692
sojwKUil5lNQK1YW73l2WjETq97h2pMmLGJ6aekd49kmCOZ85xTk45A1o5IcG/zR
2ZLBbsdLNtRzY9NjaYVdiEvh8yKdwh8rdpfQYBRC3WSBDvssT3uoBPTS5McZI/hF
29vLghH5ivi5v0xjsxs/kBgA3ulZWVg8xbz661AFybMA6ew7OZAGlJf+KiBUvExi
3DUJAlYy1vIQhC1yLDQ3rCANylUKWz7tnn3z7t6+UhqS/H9KO9uW01XSQglHT8j6
fNPvpczYkoawf2SdgthvIY893k7abV43m/4l/B5cXKDtyRrDWEtdOrM2Ng22q+/r
kaWaiP4SG91jzEkMsG4p8kk0Tu9+V2kFdigAtjL3aAPo5xF9LzItU1rVOvBew4kX
adqTeMzu0jx5PSmYgyDQYTCc0tOClSpch9n4Df/V/GKFY4KlZDPqBXfZEv/dzt+q
piM09ABz2en6u4wvECtkcosStzEiEQWMzMws6Ggq4856VzlQtIGCSXnIer91m3XX
46aNg4Y7tOS/SNesmLqnLqYjiwQSWj1FhaBVVDJeRzAFcQHVNVei5HsXz2aEYBTG
afOlgNnmGEgHIlf/hKqB
=q1wN
-----END PGP SIGNATURE-----

--F8dlzb82+Fcn6AgP--

- Raw text -


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