[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: read builtin does not return success code (0) in spite of it success
Re: read builtin does not return success code (0) in spite of it successfully read line
Mon, 27 Dec 2010 17:59:09 +0000 (UTC)
2010-12-27, 09:43(-07), Eric Blake:
> On 12/26/2010 01:29 PM, Stephane CHAZELAS wrote:
>> Bash behavior is the same as every other shell, is as documented
>> and as specified by POSIX.
> POSIX requires that the input to read be a text file. Since you aren't
> passing a text file, the behavior is undefined. POSIX does NOT require
> bash to return failure in this case, but neither does it require bash to
> return success. You should not rely on the behavior of read when the
> input does not end in a newline.
SUSv4> EXIT STATUS
SUSv4> The following exit values shall be returned:
SUSv4> Successful completion.
SUSv4> End-of-file was detected or an error occurred.
So I think you can expect a non-zero status here.