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: <4.3.1.2.20010306112805.025d8390@pop.ma.ultranet.com> X-Sender: lhall AT pop DOT ma DOT ultranet DOT com X-Mailer: QUALCOMM Windows Eudora Version 4.3.1 Date: Tue, 06 Mar 2001 11:33:32 -0500 To: robert DOT jan DOT schutten AT philips DOT com, From: "Larry Hall (RFK Partners, Inc)" Subject: Re: Broken stdio using sh.exe? In-Reply-To: <0056890023232834000002L942*@MHS> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 05:11 AM 3/6/2001, robert DOT jan DOT schutten AT philips DOT com wrote: >The problem: >------------ > >Using bash to read from stdin works as expected: > >schutten AT PC6868 ~/tmp >$ cat test.bin | ./readbin.bash >61 62 63 64 1a 61 62 63 > >Using sh to read from stdin stops after the ^Z (hex: 1a) character: > >schutten AT PC6868 ~/tmp >$ cat test.bin | ./readbin.sh >4 bytes read, 8 expected Actually, I thought bash had been changed to work like sh. The "problem" is sh (or ash in this case) reads stuff in textmode. This allows it to not trip over text mode input, which we see allot on Windows. However, this means that it interprets characters in text mode, with all the pitfalls. ^Z is an EOF in text mode. Sorry, I don't have a solution for this problem. NOTE - this response is not meant to open up the text vs binary mode debate again. Follow-up comments on this thread should keep this in mind. Thanks! Larry Hall lhall AT rfk DOT com RFK Partners, Inc. http://www.rfk.com 118 Washington Street (508) 893-9779 - RFK Office Holliston, MA 01746 (508) 893-9889 - FAX -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple