X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Shell script - is this expected behaviour? Date: Tue, 29 Nov 2011 12:24:49 -0600 Message-ID: <2BF01EB27B56CC478AD6E5A0A28931F2039D9646@A1DAL1SWPES19MB.ams.acs-inc.net> In-Reply-To: <4ED4F78D.303@redhat.com> References: <4ED4F78D DOT 303 AT redhat DOT com> From: "Nellis, Kenneth" To: Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id pATIPE5Y006001 From: Eric Blake [mailto:eblake AT redhat DOT com] Subject: Re: Shell script - is this expected behaviour? > 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. > Never feed 'read' unterminated input. Always end your text files with a > newline. When I can't control the contents of the input file, I pipe it through a filter program I wrote that adds a final newline where the last character of a stream is not a newline. --Ken Nellis -- 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