delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2009/05/01/04:05:45

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
Date: Fri, 01 May 2009 11:04:00 +0300
From: Eli Zaretskii <eliz AT gnu DOT org>
Subject: Re: GNU sed: (forced?) automatic LF conversion
In-reply-to: <5641189d-c2ac-426a-b9d5-b6686ed55ac6@p6g2000pre.googlegroups.com>
X-012-Sender: halo1 AT inter DOT net DOT il
To: djgpp AT delorie DOT com
Message-id: <838wlhdzbj.fsf@gnu.org>
References: <5641189d-c2ac-426a-b9d5-b6686ed55ac6 AT p6g2000pre DOT googlegroups DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: Rugxulo <rugxulo AT gmail DOT com>
> Date: Thu, 30 Apr 2009 15:08:03 -0700 (PDT)
> 
>    Just curious if anyone knows why the DJGPP port of GNU sed *always*
> changes a *nix LF text file into DOS CR+LF? Not a huge deal, but I can
> imagine some rare cases it wouldn't be convenient. (In any case it's
> unexpected, but since we're in DOS anyways ....) I wonder if this is
> intentional or just the libc doing this or what.

It's intentional, in the sense that the person who ported Sed
deliberately decided not to use binary-mode output, for the reason
pointed out by DJ.

There are scripts and batch files out there that rely on the fact that
the following command converts a Unix-style text file to a DOS-style
file:

	sed -e '' < unix.txt > dos.txt

- Raw text -


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