Jan Schampera wrote:
Scott Mcdermott wrote:
Bash does not seem to take the last record if it has no
trailing delimiter:

I'm sure Chet accepts patches, if he thinks it's a bug. I'm not sure if
it's a bug per se, but at least it's a usability issue to discuss. Maybe
it can be reduced to "read reacting on EOF" - and yes, the current
behaviour of reaching EOF is documented in the manual, and personally
I'm fine with it.

I don't think it's a bug.  To change it, the EOF processing would become
complicated, for not very much gain.

You can get around it by ensuring that you unset the variable before the
read, and check it after read returns EOF.  That will pick up any partial
lines.

FWIW, Posix and historical sh behavior require the trailing newline
delimiter.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                       Live Strong.  No day but today.
Chet Ramey, ITS, CWRU    [EMAIL PROTECTED]    http://cnswww.cns.cwru.edu/~chet/


Reply via email to