>> If yes, if I substitute the usual
>>      while read foo bar baz; do
>> with
>>      while read foo bar baz || [ -n "$foo" ]; do
>> would that correctly deal with "incomplete lines" for a POSIX
>> compliant shell?

It depends on what you consider correct, surely.

Silently ignore the incomplete line?
Noisily ignore the incomplete line?
Silently act as if the missing newline were there?
Noisily act as if the missing newline were there?
Incomplete line is a fatal error?
Something else?

I've done each (possibly except "something else") on occasion.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                [email protected]
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Reply via email to