This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Shell script - is this expected behaviour?
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