Has CR/LF and cat problem with textutils-2.0 been solved?
Fifer, Eric
EFifer@sanwaint.com
Wed Sep 27 06:33:00 GMT 2000
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 = <<EOF;
hello
world
EOF
open(FH, ">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 <<EOF
hello
world
EOF
But, this has CR/LF endings:
echo hello >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@sourceware.cygnus.com
More information about the Cygwin
mailing list