<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks for all the replies.<br>
<br>
Looking at the bash manpage, it looks like "%+" and "fg" are the tools
I need. I just need to see if they can be used to build a maintainable
idiom.<br>
<br>
The script I'm writing would be deployed on RHEL5, and the target
environment is already running JBoss. The languages I could use,
ordered from most-acceptable to least-acceptable (to management), are:<br>
<br>
1. Java (except then I might need another script to set up the
classpath and invoke "java" with the right arguments)<br>
<br>
2. Bash or Korn shell<br>
<br>
3. perl or python (as long as I use only vendor-supplied modules,
that is, what comes with RedHat; random stuff from CPAN would
technically require a long approval process from some lawyers).<br>
<br>
4. C<br>
<br>
5. Any other language<br>
<br>
So while C allows the most flexibility in handling the signals that
could come from the children, I/O redirection, etc., it's low on the
list for other reasons. <br>
<br>
<br>
Mike Szumlinski wrote:
<blockquote cite="mid:47419576-37EF-4FE9-BC5D-63B6D66235E5@mac.com"
type="cite">
<pre wrap="">The way I've always worked around asynchronous calls in shell is by building multiple shell scripts and then firing "monitor" scripts that poll a file in the filesystem with information.
As Clay said, it is far from optimal, but sometimes you only have certain tools to work with so you have to make due.
On Jun 15, 2012, at 6:59 AM, Clay Dowling wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On 6/14/2012 6:20 PM, David Lee Lambert wrote:
</pre>
<blockquote type="cite">
<pre wrap="">2 quick questions:
1: Is it possible to run a shell function in the background with "&"?
2: What's a good idiom for starting several jobs in the background, then waiting for them all to complete, returning nonzero and printing an error if any of them fail?
</pre>
</blockquote>
<pre wrap="">This doesn't sound like a great task for a shell script. A python script or C program, on the other hand, can do this without breaking a sweat if you look up process control in any manual (either the Python book by O'Rielly or "Programming in the Unix Environment").
Clay
_______________________________________________
linux-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:linux-user@egr.msu.edu">linux-user@egr.msu.edu</a>
<a class="moz-txt-link-freetext" href="http://mailman.egr.msu.edu/mailman/listinfo/linux-user">http://mailman.egr.msu.edu/mailman/listinfo/linux-user</a>
</pre>
</blockquote>
<pre wrap=""><!---->
_______________________________________________
linux-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:linux-user@egr.msu.edu">linux-user@egr.msu.edu</a>
<a class="moz-txt-link-freetext" href="http://mailman.egr.msu.edu/mailman/listinfo/linux-user">http://mailman.egr.msu.edu/mailman/listinfo/linux-user</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
David L. Lambert <a class="moz-txt-link-rfc2396E" href="mailto:davidl@lmert.com"><davidl@lmert.com></a> or <a class="moz-txt-link-rfc2396E" href="mailto:lamber45@msu.edu"><lamber45@msu.edu></a>
or <a class="moz-txt-link-rfc2396E" href="mailto:david.lee.lambert@acm.org"><david.lee.lambert@acm.org></a>, formerly <a class="moz-txt-link-rfc2396E" href="mailto:as4109@wayne.edu">"as4109@wayne.edu"</a>
IM: davidleelambert (Yahoo!) or <a class="moz-txt-link-abbreviated" href="mailto:lamber45@cse.msu.edu">lamber45@cse.msu.edu</a> (MSN)
Phone: 616-676-7375
</pre>
</body>
</html>