delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/01/23/13:14:54

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Wed, 23 Jan 2002 19:14:18 +0100
From: Corinna Vinschen <cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: stop cygwin sed adding ^M
Message-ID: <20020123191418.F11608@cygbert.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <C2D7D58DBFE9D111B0480060086E96350689BB99 AT mail_server DOT gft DOT com> <20020123175442 DOT GJ6765 AT redhat DOT com>
Mime-Version: 1.0
In-Reply-To: <20020123175442.GJ6765@redhat.com>
User-Agent: Mutt/1.3.22.1i

On Wed, Jan 23, 2002 at 12:54:42PM -0500, Chris Faylor wrote:
> On Wed, Jan 23, 2002 at 03:58:57PM +0100, Schaible, Jorg wrote:
> >May be you should read the FAQ regarding text mounts ??
> 
> sed is a fully ported utility.  It is supposed to read CRLF text on
> standard input and produce only UNIX-style newline endings on standard
> output.

There's one situation I know that it actually converts LF to CRLF.

Say, you have a file foo:

$ od -c foo
0000000   h   a   l   l   o  \n
0000006

and your currently in a textmode mounted directory, then

$ sed -e 's/ll/nn/' foo > bar

creates actually a CRLF file bar:

$ od -c bar
0000000   h   a   n   n   o  \r  \n
0000007

and that's defined behaviour.  That isn't even going on in sed.
The stdio redirection has already happened in the shell and sed
is just using that file descriptor.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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