X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_20,MISSING_HEADERS,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Date: Tue, 29 Nov 2011 14:15:58 -0600 (CST) From: Tim McDaniel cc: cygwin AT cygwin DOT com Subject: RE: Shell script - is this expected behaviour? In-Reply-To: <2BF01EB27B56CC478AD6E5A0A28931F2039D9646@A1DAL1SWPES19MB.ams.acs-inc.net> Message-ID: References: <4ED4F78D DOT 303 AT redhat DOT com> <2BF01EB27B56CC478AD6E5A0A28931F2039D9646 AT A1DAL1SWPES19MB DOT ams DOT acs-inc DOT net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-IsSubscribed: yes 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 Nellis, Kenneth wrote: > From: Eric Blake >> 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. I don't have the time to experiment at the moment, but I'm pretty sure that some of the standard tools append a line terminator if it's not already on the last line of their input. sed or awk or gawk, maybe? Anyway, if you can stumble on such a program, it can save you having to write and maintain and distribute a filter to all your environments. -- Tim McDaniel -- 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