Re: out of order execution of shell commands

From: Olaf Hering
Date: Sat Oct 09 2004 - 15:39:16 EST


On Thu, Oct 07, Olaf Hering wrote:

>
> we have a weird bug where the open of the shell output redirection
> happens before the mkdir command returns.
> As a result, the redirection will fail. Unexpected data loss.

...
> for l in `/bin/cat ten`; do
> /bin/mkdir $h$i/$j/$k/$l
> /bin/echo $h$i/$j/$k/$l > ./$h$i/$j/$k/$l/DIRNAME || /bin/kill -STOP `/bin/cat /dev/shm/bug42232-pid-*`
> /bin/dd if=/dev/zero of=$h$i/$j/$k/$l/data bs=1024 count=1 &> /dev/zero
> done
...

looks like the dd and the mkdir will get the same pid,
and bash can not deal with it.

--
USB is for mice, FireWire is for men!

sUse lINUX ag, nÃRNBERG
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/