sh script difficulties (running parallel functions)

Andy Harrison aharrison at gmail.com
Thu Nov 1 09:58:10 PDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On 11/1/07, David Naylor  wrote:
>   # !!! Somehow wait for over workers to finish before continuing !!!
> }
>
> #Finished
>
> Furthermore, how can signals be handled such that the signals get
> accumulated and once all the other workers have finished the signals get
> passed on (appropriately)


One simplistic way of doing something like that is to make each worker
process write a file out to disk upon completion.  Then have a while
loop that sleeps for a minute and then checks for the existence of
that file and if it finds it, execute other commands.

Probably not the cleanest method, but I think you'll find that
handling forks and signals in a shell script is more trouble than it's
worth.

- --
Andy Harrison
public key: 0x67518262
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: http://firegpg.tuxfamily.org

iD8DBQFHKgQ1NTm8fWdRgmIRAn7eAKCZthrDzv0j7J6urphY3ohm6bSPZgCeIAt6
vhC2Zxw0ZTxw8eT+NZ/Uktg=
=schR
-----END PGP SIGNATURE-----


More information about the freebsd-questions mailing list