X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0	tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RP_MATCHES_RCVD,SPF_HELO_PASS
X-Spam-Check-By: sourceware.org
Mail-Followup-To: cygwin@cygwin.com
To: cygwin@cygwin.com
From: Gary <listgj-cygwin@yahoo.co.uk>
Subject: Re: Shell script - is this expected behaviour?
Date: Tue, 29 Nov 2011 17:50:45 +0100
Lines: 21
Message-ID: <jb32h6$qae$1@dough.gmane.org>
References: <jb26vu$5tc$1@dough.gmane.org> <4ED4F78D.303@redhat.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (cygwin)
X-No-Archive: Yes
Mail-Copies-To: never
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Eric Blake wrote:
> On 11/29/2011 02:00 AM, Gary wrote:
>> If I have a shell script which reads a file which does not have an end
>> of line character at the end if it's only line, it does not read
>> anything.
>
> Not cygwin specific.

Okay, thanks. That's what I was wondering.

>> If it's expected behaviour, what's the workaround?
>
> Never feed 'read' unterminated input.  Always end your text files with a
> newline.

Yeah, sadly the input file isn't under my control. I ended up just
stuffing a newline on the end regardless. I would read the file first to
find out if it was necessary, but...

-- 
Gary        Please do NOT send me 'courtesy' replies off-list.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

