delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/06/02/20:06:10

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <39384BD0.CCD607DA@veritas.com>
Date: Fri, 02 Jun 2000 17:05:36 -0700
From: Bob McGowan <rmcgowan AT veritas DOT com>
Organization: VERITAS Software
X-Mailer: Mozilla 4.73 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: earnie_boyd AT yahoo DOT com
CC: Charles Wilson <cwilson AT ece DOT gatech DOT edu>, cygwin AT sourceware DOT cygnus DOT com
Subject: Re: New sed in latest
References: <20000602203057 DOT 18834 DOT qmail AT web115 DOT yahoomail DOT com>

Earnie Boyd wrote:
> 
> --- Charles Wilson <cwilson AT ece DOT gatech DOT edu> wrote:
> > So, with the new sed behavior the following is no longer going to work,
> > right?
> 
> No, not right.

It _looks_ like Charles is right....

> >
> > ---dos2unix----
> > #!/bin/bash
> > sed 's/^M//' $1
> > ---------------
> >
> > Where the '^M' is generated by pressing CTRL-V, CTRL-M.
> >
> 
> In text mode, it is the \n that terminates the read.  If there is a \r
> preceding the \n it will also be removed and the count read reduced by one.  If
> there is no preceding \r then the count returned is the number actually read.
> 

....because, on a cursory review, the sed script mentioned, which used
to find \r in the DOS format file and remove them, thus making a UNIX
format file, will no longer find them, since as you say they have been
"removed and the count reduced by one."

But sed writes to standard output.  So the correct answer (I think) is
that, to capture the "dos2unix" output, the script would need to be
redirected to a file.  If the file is in a binary mounted environment,
then it will be UNIX format, if it is text mounted it would continue to
be DOS format.

Is this an accurate analysis?

Thanks,

-- 
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
rmcgowan AT veritas DOT com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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