Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <779F20BCCE5AD31186A50008C75D99791717AE@silldn_mail1.sanwaint.com> From: "Fifer, Eric" To: "'cygwin AT sources DOT redhat DOT com'" Subject: RE: Has CR/LF and cat problem with textutils-2.0 been solved? Date: Wed, 27 Sep 2000 14:30:31 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Chris Faylor wrote: >On Tue, Sep 26, 2000 at 07:59:27PM +0200, Bernard Dautrevaux wrote: >>> From: Matthew Smith >>> >>> I would be interested in comments from the mailing list. If >>> people want >>> \r's stripped, I will implement the changes. >>> >>>>I think it is arguable whether cat should strip CRs or not. It is not >>>>arguable whether bash's backtick handling should treat its input as >>>text mode. >> >>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. > >This was my point. We fixed ash to do the right thing and I've been waiting >patiently for the bash maintainer to fix bash as well. Is it possible to get a better idea of what the "right thing" is? + Perl has a similar backtick syntax, but is fine handling binary data. I think it would be wrong to cripple its binary abilities by setting text mode on backtick input. However, as cat works now, on a text mount this will fail: #!perl $out = <foo"); print FH $out; close(FH); $in = `cat foo`; print "not ok\n" if($out ne $in); + On a text mount, this results in LF endings: #!sh cat >foo <foo echo world >>foo + A text file on a text mount (CR/LF endings) and a text file on a binary mount (LF endings) concatenated together. The current cat will result in a file with mixed CR/LF and LF endings. + A binary file on a text mount copied into another file (cat foo.exe >bar.exe). This now works with the latest cat, with the B20.1 cat it would have "translated" the file. Eric Fifer __________________________________________________________________________________ IMPORTANT: This email is confidential and may also be legally privileged. If you have received this email in error, you are on notice of its status. If you are not the intended recipient, please notify us immediately by reply email or by telephoning Sanwa International plc's IT Helpdesk on +44 (20) 7330 0444. Then delete this email from your system. You should not copy it or use it for any purpose or disclose its contents to any other person. Any views contained herein, express or implied, are those of the author and may not necessarily reflect those of Sanwa International plc. Sanwa International plc reserves the right to monitor all emails within its network. Email may be susceptible to virus infection, data corruption, interception and unauthorised amendment. Sanwa International plc does not accept liability for any such infection, corruption, interception or amendment or the consequences thereof. -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com