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='bash' 
-DSHELL -DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include 
-I../bash/lib   -g -O2 -Wall
uname output: Linux mmarkk-work 2.6.35-24-generic-pae #42-Ubuntu SMP Thu 
Dec 2 03:21:31 UTC 2010 i686 GNU/Linux

Machine Type: i686-pc-linux-gnu

Bash Version: 4.1
Patch Level: 5
Release Status: release

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:/tmp$ echo -n bbb > /tmp/test2
mma...@mmarkk-work:/tmp$ read y < /tmp/test2 && echo success
mma...@mmarkk-work:/tmp$ echo $y
bbb
mma...@mmarkk-work:/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).







Aliases in subbshell does not work as expected

2009-01-11 Thread Коренберг Марк

Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALED $uname output: Linux mmarkk-desktop 
2.6.27-11-generic #1 SMP Thu Jan 8 08:38:33 UTC 2009 i686 GNU/Linux

Machine Type: i486-pc-linux-gnu

Bash Version: 3.2
Patch Level: 39
Release Status: release

Description:
   See Repeat-by section.

Repeat-By:
   alias aaa='echo aaa'; ( alias aaa='echo bbb'; aaa ; )
   Will print 'aaa' instead of 'bbb' as I expect.