delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2009/05/02/07:30:55

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Rugxulo <rugxulo AT gmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: GNU sed: (forced?) automatic LF conversion
Date: Sat, 2 May 2009 04:29:57 -0700 (PDT)
Organization: http://groups.google.com
Lines: 28
Message-ID: <5e7a0110-6639-438b-a3b4-8eeeb31f8349@p4g2000vba.googlegroups.com>
References: <5641189d-c2ac-426a-b9d5-b6686ed55ac6 AT p6g2000pre DOT googlegroups DOT com>
<838wlhdzbj DOT fsf AT gnu DOT org>
NNTP-Posting-Host: 65.13.115.246
Mime-Version: 1.0
X-Trace: posting.google.com 1241263797 3466 127.0.0.1 (2 May 2009 11:29:57 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Sat, 2 May 2009 11:29:57 +0000 (UTC)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: p4g2000vba.googlegroups.com; posting-host=65.13.115.246;
posting-account=p5rsXQoAAAB8KPnVlgg9E_vlm2dvVhfO
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.10)
Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi,

On May 1, 3:04=A0am, Eli Zaretskii <e DOT  DOT  DOT  AT gnu DOT org> wrote:
> > From: Rugxulo <rugx DOT  DOT  DOT  AT gmail DOT com>
> > Date: Thu, 30 Apr 2009 15:08:03 -0700 (PDT)
>
> > =A0 =A0Just curious if anyone knows why the DJGPP port of GNU sed *alwa=
ys*
> > 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:
>
> =A0 =A0 =A0 =A0 sed -e '' < unix.txt > dos.txt

Well, that's fine, and I was aware of that, just thought it was bad
manners to change a file without asking.   ;-)
It's not the end of the world, esp. since we have dtou and utod (which
should be combined, IMHO). Just that some tools still can't handle one
or the other, so you have to be careful.

- Raw text -


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