Hi Harald,

>   set -- $(seq 1 100)
>   for i
>   do
>     : &
>     sleep .1
>   done
>   for i
>   do
>     wait %$i
>   done
>
>This is a valid script and works fine in dash. Your change breaks this by not 
>keeping the jobs around long enough, and I hope this test script shows that 
>there is no way to keep the jobs around long enough but by allocating ever 
>more memory.

I must have confused two concepts: waited process in OS -vs- waited job inside 
shell interpreter. I am trying to see how it work in practice:

# true & false &
#
[2] + Done(1)                    false
[1] + Done                       true
# wait 2
# echo $?
127

As we preserve job exit codes, I would expect wait command to read them and 
free associated jobtab slots. In above example I expect to see 1 in place of 
127. What do I miss here?

Many thanks for your help.

Best,
Vitaly  

Reply via email to