public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Steven Penny <svnpenn@gmail.com>
To: cygwin@cygwin.com
Subject: Re: [ANNOUNCEMENT] Updated [test]: sed-4.4-1
Date: Sat, 11 Feb 2017 23:01:00 -0000	[thread overview]
Message-ID: <589f97c1.1c139d0a.60fe5.98e2@mx.google.com> (raw)
In-Reply-To: <announce.fef1110c-ac22-0877-6602-ae7f0acb7e54@redhat.com>

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

This is great, but can we do it for Awk too?

    $ 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

Currently you have to make this awful incantation:

    $ unset POSIXLY_CORRECT
    $ printf 'hello world\r\n' | awk -vBINMODE=1 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

BINMODE only gets parsed on the command line; it is not recognized even in the
BEGIN section. This makes it impossible to write portable Awk scripts with
respect to carriage returns.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2017-02-11 23:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-11 17:20 Eric Blake (cygwin)
2017-02-11 23:01 ` Steven Penny [this message]
2017-02-12 11:32   ` Corinna Vinschen
2017-02-12 15:13     ` Steven Penny
2017-02-13 14:15       ` Nellis, Kenneth (Conduent)
2017-02-13 15:53         ` cyg Simple
2017-02-13 19:07           ` Eric Blake
2017-02-13 19:15     ` Eric Blake
2017-02-16  5:05       ` Steven Penny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=589f97c1.1c139d0a.60fe5.98e2@mx.google.com \
    --to=svnpenn@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).