public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Larry Hall <lhall@rfk.com>
To: Urban Widmark <urban@svenskatest.se>, gnu-win32@cygnus.com
Subject: Re: When is \n converted to \r\n? and why?
Date: Fri, 30 Oct 1998 05:08:00 -0000	[thread overview]
Message-ID: <3.0.5.32.19981029165927.00ab4390@pop.ma.ultranet.com> (raw)
In-Reply-To: <Pine.GSO.3.96.981028153437.966D-100000@fungus>

At 04:18 PM 10/28/98 +0100, Urban Widmark wrote:
>(using cygwin32 19.3 & 19.1?)
>
>If I create a small example file:
>
>$ echo a > xx
>$ ls -l xx
>-rw-r--r--   1 544      everyone        3 Oct 28 15:43 xx
>
>it will contain "a\r\n" since I use the default (non-binary mounts)
>
>But if I do:
>$ echo a | wc -c
>      2
>
>I get only 2 chars ... ok, so the translation is done when writing to
>disk. Then something like this will fail:
>
>$ echo a | tr -d '\r' > yy
>$ ls -l yy
>-rw-r--r--   1 544      everyone        3 Oct 28 15:48 yy
>
>So how am I supposed to remove the \r from the echo output?  Well, I know
>non-cygwin ways to remove the \r, the issue is if this is a tr bug, a
>cygwin conversion bug or ...

Nope.  Its not a tr or any other kind of bug.  You said it yourself above.
Translation is done when writing to (and reading from) the disk.  How can
tr be expected to remove something that doesn't exist.  Remember, text/
binary modes have to do with how things are written to files on the disk,
not how they are handled in stdin, stdout, pipes, and whatever.


Larry
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

  reply	other threads:[~1998-10-30  5:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-28 11:32 Urban Widmark
1998-10-30  5:08 ` Larry Hall [this message]
1998-10-30  5:08   ` Urban Widmark
1998-10-30  5:08 Earnie Boyd
1998-10-29 18:15 ` Christopher Faylor
     [not found] <Pine.GSO.3.96.981028153437.966D-100000.cygnus.gnu-win32@fungus>
1998-10-30  9:06 ` Christopher G. Faylor
1998-10-31  8:05 Earnie Boyd
1998-10-31 10:50 Earnie Boyd
1998-11-02  5:50 ` Urban Widmark
     [not found] <19981030020029.5367.rocketmail.cygnus.gnu-win32@send102.yahoomail.com>
1998-10-31 18:06 ` Christopher G. Faylor

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=3.0.5.32.19981029165927.00ab4390@pop.ma.ultranet.com \
    --to=lhall@rfk.com \
    --cc=gnu-win32@cygnus.com \
    --cc=urban@svenskatest.se \
    /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).