Re: Unix Question

  • From: "Shawn Ferris" <shawn@xxxxxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Wed, 26 May 2004 14:14:15 -0600 (MDT)

> The problem that Ryan has comes from trying to solve it with the wrong
> tool

.. snip .. snip ..

> Multithreading with threads communicating with each other is
> something that should be done by specialized scripting languages.


So.. if it can be done via korn shell.. does that promote it to a
specialized scripting language? This is very rudimentary, but should
suffice for the task at hand. Mladen is mostly correct, but IPC is a
sledge hammer if all that you want to do is fork some processes and figure
out their exit status. ksh can do this fine. 8D

Take this example:

#!/bin/ksh

( sleep 5; exit 2 ) &
p1=$!

( sleep 3; exit 1 ) &
p2=$!

( sleep 1; exit 0 ) &
p3=$!

wait $p2; echo "p2:$?"
wait $p1; echo "p1:$?"
wait $p3; echo "p3:$?"

This works for this example. But as Mladen suggests, Korn isn't the best
of tools for this. YMMV

Shawn
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: