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

[no subject]



On 05/03/2005 06:15 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"
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
&gt; <a  rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale";>http://www.ale.org/mailman/listinfo/ale</a>

-- 

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Mike Murphy
781 Inman Mews Drive Atlanta GA 30307
Landline: 404-653-1070
Mobile: 404-545-6234
Email: mike at tyderia.net
AIM: mmichael453
JDAM: 33:45:14.0584N  84:21:43.038W
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00046" href="msg00046.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-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00039" href="msg00039.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-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00039.html">[ale] Perplexed by bash</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00041.html">[ale] Wireless DSL?</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00039.html">[ale] Perplexed by bash</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00046.html">[ale] Perplexed by bash</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00040"><strong>Date</strong></a></li>
<li><a href="threads.html#00040"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

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