Probably a bug in ash

Seb sbb at tuxfamily.org
Mon Jul 16 18:28:02 UTC 2007


Le Sat, 14 Jul 2007 19:20:06 +0100
Denis Vlasenko <vda.linux at googlemail.com> a écrit:


> I'm curious, tho, whether this will break other job-related stuff.

I don't know if it's a consequense of your patch or just a bug masked
by the previous, but I notice another curious behaviour. When I test
the number of running jobs by sending the output of jobs to another
command, I get an infinite loop but no problem when jobs isn't piped :

#!/bin/sh

echo "test with 'jobs', not piped"
sleep 2s &
sleep 3s &
while [ "$(jobs | sed 2p -n)" ]; do
    jobs
done
echo "test with piped 'jobs'..."
wait
sleep 2s &
sleep 3s &
while [ "$(jobs | sed 2p -n)" ]; do
    jobs | sed 2p -n # here we enter in an infinite loop
done
wait
# EOF

It looks like if a piped 'jobs' was unable to totally remove the
achieved jobs from the list.

++
Seb

P-S. My bash-3.1.17(2) has the same behaviour but only when there is
exactly one job.



More information about the busybox mailing list