[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



--Joe

On Tuesday, May 03, 2005 6:16 PM, John Wells wrote:
>
> Can anyone tell me why the while loop in the below code affects the
> setting of the variable RC?  I'm at a loss.  Remove the while loop, and it
> works just fine...
> --
> #!/bin/bash
> function getRC
> {
>   RC="123"
> }
>
> getRC \
> | while read line
> do
>   echo "456"
> done
>
> echo "RC: $RC"
>


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00045" href="msg00045.html">[ale] Perplexed by bash</a></strong>
<ul><li><em>From:</em> jb at sourceillustrated.com (John Wells)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00042.html">[ale] Perplexed by bash</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00044.html">[ale] FAX service recommendation?</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00042.html">[ale] Perplexed by bash</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00045.html">[ale] Perplexed by bash</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00043"><strong>Date</strong></a></li>
<li><a href="threads.html#00043"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>