[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Tue May 3 21:09:42 2005 -->
- <!--x-from-r13: wo ng fbheprvyyhfgengrq.pbz (Xbua Iryyf) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] Perplexed by bash -->
- <li><em>date</em>: Tue May 3 21:09:42 2005</li>
- <li><em>from</em>: jb at sourceillustrated.com (John Wells)</li>
- <li><em>in-reply-to</em>: <[email protected]></li>
- <li><em>references</em>: <[email protected]></li>
- <li><em>subject</em>: [ale] Perplexed by bash</li>
ahhh...ok. I wasn't aware that a pipe caused _both_ sides to be run in a
subshell.
To answer the question about what we're trying to do...we have a function
which starts a number of server processes. We want to take the standard
out and error from this function call and, in realtime as new output is
available, pass it to another function that handles logging. So, in the
real script, you have something like:
start_processes 2>&1 | while read line
do
log_message $line
done
This works just fine, but the final requuirement is to capture the return
value of the start_processes call. Obviously, it's too late after the
loop, so my intent was to have the function set the RC variable to its
return value...evidently not thr right approach either.
Any suggestions?
Thanks, as always, for the help!
John
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00043" href="msg00043.html">[ale] Perplexed by bash</a></strong>
<ul><li><em>From:</em> joe at madewell.com (Joe Steele)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00044.html">[ale] FAX service recommendation?</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00046.html">[ale] Perplexed by bash</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00043.html">[ale] Perplexed by bash</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00053.html">[ale] Perplexed by bash</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00045"><strong>Date</strong></a></li>
<li><a href="threads.html#00045"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>