bug-bash
[Top][All Lists]
Advanced

[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


From: Eric Blake
Subject: Re: read builtin does not return success code (0) in spite of it successfully read line
Date: Mon, 27 Dec 2010 09:43:37 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

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.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]