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: Davide Brini
Subject: Re: read builtin does not return success code (0) in spite of it successfully read line
Date: Sat, 25 Dec 2010 14:29:47 +0000
User-agent:

On Fri, 24 Dec 2010 13:20:55 +0500 Коренберг Марк <address@hidden>
wrote:

> GOOD CASE:
> address@hidden:/tmp$ echo aaa > /tmp/test1
> address@hidden:/tmp$ read x < /tmp/test1 && echo success
> success
> address@hidden:/tmp$ echo $x
> aaa
> address@hidden:/tmp$
> 
> BUGGY CASE:
> address@hidden:/tmp$ echo -n bbb > /tmp/test2
> address@hidden:/tmp$ read y < /tmp/test2 && echo success
> address@hidden:/tmp$ echo $y
> bbb
> address@hidden:/tmp$
> 
> So, if EOF detected but something is read successfully, please do not 
> report error !
> 
> 
> The "dialog" command when writes to --output-fd does not append newline.
> so
> read result < resultfile || return 1
> will fail, but should not (by correct logick).

Please see

http://lists.gnu.org/archive/html/bug-bash/2010-12/msg00011.html

-- 
D.



reply via email to

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