This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Shell script - is this expected behaviour?


From: Eric Blake [mailto:eblake@redhat.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.

<snip>

> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]