delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/09/26/14:42:54

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <00e901c027e9$f5ec6f30$c4acb018@home.com>
From: "Erik Nolte" <enolte AT campuspipeline DOT com>
To: "Bernard Dautrevaux" <Dautrevaux AT microprocess DOT com>,
"'Matthew Smith'" <matts AT bluesguitar DOT org>,
"Cygwin" <cygwin AT sources DOT redhat DOT com>
References: <17B78BDF120BD411B70100500422FC6309E10E AT IIS000>
Subject: Re: Has CR/LF and cat problem with textutils-2.0 been solved?
Date: Tue, 26 Sep 2000 12:45:35 -0600
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400

> I don't think cat should strip \r's on input; I quite often use cat to
> concatenate binary data :-)
>
> However *all* shells (and not only bash) *must* read the standard output
of
> command expansion (backtick) in *text* mode, as it *does* expect text and
is
> *not* willing to handle binary data there.
>
> The problem here is thus IMNSHO in cat but in the shell, so *please* don't
> feed the cat with a new bug :-)

I agree.  Bash should do the CR-LF conversion for both forms of command
output expansion: `cmd` and $(cmd).  Sh should do the conversion for the
backticks form.

It's interesting that cat was placed in the line-oriented textutils package
rather than something like fileutils or shellutils.  But then again so was
od and the checksum utilities like sum and md5sum.

What cat's -B option for?  Since it's not in the FSF documentation, I
thought it was a cygwin addition that forced cat to *not* do the LF to CR-LF
output translation.  To me it implies that cat is reading and writing in
textmode, not binmode.

Since it will take a while to fix all the shells, should a --text flag be
added to cat?  I know it's ugly, but it saves people the trouble of having
to find a B20.1 version of cat.

- Erik


--
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