delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/11/05/10:59:18

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <19991105145850.21215.rocketmail@web108.yahoomail.com>
Date: Fri, 5 Nov 1999 06:58:50 -0800 (PST)
From: Earnie Boyd <earnie_boyd AT yahoo DOT com>
Reply-To: earnie_boydNOREPLY AT yahoo DOT com
Subject: RE: B20: bash does not like CRLF on stdin
To: Anton Leherbauer <aleherbauer AT takefive DOT co DOT at>,
"'cygwin AT sourceware DOT cygnus DOT com'" <cygwin AT sourceware DOT cygnus DOT com>
MIME-Version: 1.0

Ok. Sorry. To open redirection input and output in text mode SET
CYGWIN=nobinmode before starting bash.

Earnie.

--- Anton Leherbauer <aleherbauer AT takefive DOT co DOT at> wrote:
> There is no TTY in the CYGWN variable.
> It's just the fact that bash reads stdin
> in binary mode, not in text mode.
> If it can handle CRLF correctly, when
> giving it the script as argument, then
> it should also cope with CRLF on stdin. 
> -IMHO
> 
> Toni
> 
> 
> > -----Original Message-----
> > From: Earnie Boyd [mailto:earnie_boyd AT yahoo DOT com]
> > Sent: Thursday, November 04, 1999 6:22 PM
> > To: Anton Leherbauer; 'cygwin AT sourceware DOT cygnus DOT com'
> > Subject: Re: B20: bash does not like CRLF on stdin
> > 
> > 
> > Known FAQ:
> > 
> > You cannot have TTY set in the CYGWIN variable when communicating with
> > NON-CYGWIN binaries.  You must set this to NOTTY or remove it 
> > from the CYGWIN
> > variable.
> > 
> > Earnie.
> > 
> > --- Anton Leherbauer <aleherbauer AT takefive DOT co DOT at> wrote:
> > > Create from the command line:
> > > 
> > > 	C:> echo ls > foo.sh
> > > 	C:> bash foo.sh
> > > 	    ... lots of output ...
> > > 	C:> bash < foo.sh
> > > 	: No such file or directory
> > > 
> > > The problem is that bash treats stdin as binary, thus leaving the
> > > CR/LF in place. Interestingly, the following experiment works:
> > > 
> > > 	C:> bash
> > > 	bash-2.0$ bash < foo.sh
> > > 	    ... lots of output ...
> > > 
> > > This happens with cygwin B20 and bash 2.03 and is
> > > especially bad, when using bash together with clearmake,
> > > because clearmake executes build scripts in the above manner.
> > > 
> > > Jim Chapman [jim DOT chapman AT xstreamis DOT com]
> > > provided me with a fix to the problem:
> > > 
> > > Edit make_cmd.c in function make_bare_word() near line 53 
> > (version is 2.02).
> > > Make it look like
> > > -------------------------------- begin ----------------------------
> > > make_bare_word (string)
> > >      char *string;
> > > {
> > >   WORD_DESC *temp;
> > > 
> > >   temp = (WORD_DESC *)xmalloc (sizeof (WORD_DESC));
> > >   if (*string)
> > >   {
> > >     /* JC. Remove any rogue carriage return char - 12/21/98. */
> > >     int j, slen;
> > >     slen = strlen(string);
> > >     if (string[slen-1] == 0x0d)
> > >     {
> > >       string[slen-1] = '\0';
> > >     }
> > >     
> > >     temp->word = savestring (string);
> > >   }
> > >   else
> > >     {
> > >       temp->word = xmalloc (1);
> > >       temp->word[0] = '\0';
> > >     }
> > > 
> > >   temp->flags = 0;
> > >   return (temp);
> > > }
> > > --------------------------------- end 
> > -------------------------------
> > > 
> > > It would be great, if the fix would get into the common 
> > distribution.
> > > 
> > > Thanks,
> > > Toni
> > > --
> > > Anton Leherbauer                     Phone: +43 662 457 915-89
> > > TakeFive Software GmbH               Fax:   +43 662 457 915-6
> > > Jakob-Haringer-Str. 8                http://www.TakeFive.com/
> > > A-5020 Salzburg, Austria             
> > mailto:aleherbauer AT TakeFive DOT co DOT at
> > > 
> > >              The 
> > Source Code Engineering Company
> > > 
> > > --
> > > Want to unsubscribe from this list?
> > > Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
> > > 
> > > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Bid and sell for free at http://auctions.yahoo.com
> > 
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
> 
> 

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

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