This bug report was just submitted via
http://defect.opensolaris.org/bz/show_bug.cgi?id=15478
> Hello,
>    It seems ksh93 doesn't wait for a backgrounded shell built-in (like setting
> a environment variable):
> [Expected behavior]:
> cl...@opensolaris:~$ foo="A"; i=0; while (( i <= 2 )); do i=$((i+1));
> foo=$(sleep 1; echo "B"); done; wait; print "$foo"
> B
>
> [Un-expected behavior when backgrounding processes]:
> cl...@opensolaris:~$ foo="A"; i=0; while (( i <= 2 )); do i=$((i+1));
> foo=$(sleep 1; echo "B") & done; wait; print "$foo"
> [1]    11936
> [2]    11937
> [3]    11938
> [3] +  Done                    foo="A"; i=0; while (( i <= 2 )); do 
> i=$((i+1));
> foo=$(sleep 1; echo "B") & done; wait; print "$foo"
> [2] -  Done                    foo="A"; i=0; while (( i <= 2 )); do 
> i=$((i+1));
> foo=$(sleep 1; echo "B") & done; wait; print "$foo"
> [1]    DoneA
>                     foo="A"; i=0; while (( i <= 2 )); do i=$((i+1));
> foo=$(sleep 1; echo "B") & done; wait; print "$foo"
>
> Note that B is the expected result, however, when backgrounding processes, 
> $foo
> is still set to A.
>
> Thank you,
> Clay

Is this the expected behaviour or a bug?

Olga
-- 
      ,   _                                    _   ,
     { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
.----'-/`-/     [email protected]   \-`\-'----.
 `'-..-| /     Solaris/BSD//C/C++ programmer   \ |-..-'`
      /\/\                                     /\/\
      `--`                                      `--`
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to