X-Recipient: archive-cygwin AT delorie DOT 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 AT cygwin DOT com To: cygwin AT cygwin DOT com From: Gary Subject: Re: Shell script - is this expected behaviour? Date: Tue, 29 Nov 2011 17:50:45 +0100 Lines: 21 Message-ID: References: <4ED4F78D DOT 303 AT redhat DOT 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 AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT 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