Re: read builtin does not return success code (0) in spite of it successfully read line

2010-12-27 Thread Stephane CHAZELAS
2010-12-27, 11:53(-07), Eric Blake: [...] >> So I think you can expect a non-zero status here. > > All you can expect is that you have undefined results. Undefined > results include zero status. [...] Yes, sorry, you're right. Bad reasoning of mine. The >0 on EOF is oviously on end of text file,

Re: read builtin does not return success code (0) in spite of it successfully read line

2010-12-27 Thread Eric Blake
On 12/27/2010 10:59 AM, Stephane CHAZELAS wrote: > 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 tex

Re: read builtin does not return success code (0) in spite of it successfully read line

2010-12-27 Thread Stephane CHAZELAS
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 behav

Re: read builtin does not return success code (0) in spite of it successfully read line

2010-12-27 Thread 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 r

Re: read builtin does not return success code (0) in spite of it successfully read line

2010-12-26 Thread Stephane CHAZELAS
2010-12-24, 13:20(+05), Коренберг Марк: [...] > mma...@mmarkk-work:/tmp$ echo aaa > /tmp/test1 > mma...@mmarkk-work:/tmp$ read x < /tmp/test1 && echo success > success > mma...@mmarkk-work:/tmp$ echo $x > aaa > mma...@mmarkk-work:/tmp$ > > BUGGY CASE: > mma...@mmarkk-work:/tmp$ echo -n bbb > /tmp/t

Re: read builtin does not return success code (0) in spite of it successfully read line

2010-12-25 Thread Davide Brini
On Fri, 24 Dec 2010 13:20:55 +0500 Коренберг Марк wrote: > GOOD CASE: > mma...@mmarkk-work:/tmp$ echo aaa > /tmp/test1 > mma...@mmarkk-work:/tmp$ read x < /tmp/test1 && echo success > success > mma...@mmarkk-work:/tmp$ echo $x > aaa > mma...@mmarkk-work:/tmp$ > > BUGGY CASE: > mma...@mmarkk-work

read builtin does not return success code (0) in spite of it successfully read line

2010-12-25 Thread Коренберг Марк
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE=