This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Has CR/LF and cat problem with textutils-2.0 been solved?


I have observed a CR/LF problem with another textutil, sort. In this case
the problem seems to be internal to sort, but might be the result of changes
in the runtime library. I've described the problem here:
http://sources.redhat.com/ml/cygwin/2000-08/msg01199.html, and haven't had
the time to go into it until now.

While I personally feel that 'textmode' is a cul-de-sac better avoided in
the first place, it's a fact that some people rely on it. But we *must*
agree on how and where it should be implemented (so that I know how to avoid
it ;). In this conversation, some policy statements pop up, like:

 "cygwin *must* be UNIX compatible, so a cygwin-only option to cat would be
  unusable for all people sharing shell scripts or Makefiles between UNIX
and 
  cygwin"

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

I wonder if there's authoritative collection of these statements somewhere?
Most of the CR/LF (CR\LF CR\\LF 'CR\LF') problems that we see arise from
confusion or disagreement about what goes on where.

Kind regards,
Peter Ring


-----Original Message-----
From: Bernard Dautrevaux [mailto:Dautrevaux@microprocess.com]
Sent: 27. september 2000 09:27
To: 'Erik Nolte'; Bernard Dautrevaux; 'Matthew Smith'; Cygwin
Subject: RE: Has CR/LF and cat problem with textutils-2.0 been solved?


> -----Original Message-----
> From: Erik Nolte [mailto:enolte@campuspipeline.com]
> Sent: Tuesday, September 26, 2000 8:46 PM
> To: Bernard Dautrevaux; 'Matthew Smith'; Cygwin
> Subject: Re: Has CR/LF and cat problem with textutils-2.0 been solved?
> 
> 
> 
> 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.

I don't think so; the first reason is that you have the problem for all
commands you use in backticks, be it cat or ls or a series of echoes (or at
least you should have the problem; I had to reinstall B20.1 for another
reason -- user compatibility for support :-) --  so I can't check right now,
but th eproper behavior is that all these write in text and as such they may
output CR/LFs).

The second reason is that cygwin *must* be UNIX compatible, so a cygwin-only
option to cat would be unusable for all people sharing shell scripts or
Makefiles between UNIX and cygwin ;-(

The third reason is that (as Chris already answered) you can use ash instead
of bash: ash *was* fixed in this respect and correctly strip CRs from the
output of backticks.

The last reason is that you can look at the source and submit a patch :-)

Regards,

	Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]