<html>
<font size=3>Well, uhh, yes, it does once it COMPLETES the final line. In
this case, it is executing $0 and waiting for it to finish.&nbsp;
Unfortunately, it doesn't ever finish because it spawns another copy that
waits for its child to finish, and so on ad infinitum.&nbsp; An excellent
example of a classic case of recursion.<br>
<br>
Try this instead:<br>
<br>
while :<br>
do<br>
cat /proc/mdstat<br>
sleep 3<br>
done<br>
<br>
Regards,<br>
Ken<br>
<br>
At 07:55 PM 6/26/2002 -0500, you wrote:<br>
<blockquote type=cite cite>OK, will someone explain what it was I did and
why it affected my system the<br>
way it did?<br>
<br>
I am trying to do a fresh software RAID-1 install of Slackware 8.1.&nbsp;
There<br>
is, of course, no support for this, but I'm banging my head anyway.&nbsp;
During<br>
my adventures I decided that I wanted to watch the progress of<br>
&quot;/proc/mdstat&quot;.&nbsp; I went about making a bash script called
loop.&nbsp; (and how it<br>
was aptly named!)<br>
<br>
[ # loop]<br>
cat /proc/mdstat #show the raid device status<br>
sleep 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
#pause three seconds<br>
$0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
#rerun this command<br>
[/ # loop]<br>
<br>
Ok...not only was I NOT able to break out of this, but when I went
to<br>
another term screen and did a 'ps&nbsp; -aux' you can imagine the humor
as I saw<br>
hundreds of spawned '-sh' shells.<br>
<br>
I finally renamed loop to stop the loop.<br>
<br>
Does a shell script not end when it reaches the last line?<br>
<br>
-Richard<br>
<br>
<br>
_______________________________________________<br>
<a href="http://www.ntlug.org/mailman/listinfo/discuss" eudora="autourl">http://www.ntlug.org/mailman/listinfo/discuss</a>
</font></blockquote></html>