<br><div class="gmail_quote">On Sat, May 5, 2012 at 1:17 AM, Simon Peter <span dir="ltr"><<a href="mailto:speter@inf.ethz.ch" target="_blank">speter@inf.ethz.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for your patch!<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- trap "pkill -P $$" SIGINT can not kill previous cat process properly,<br>
so each time I'll get a "device<br>
busy" error<br>
</blockquote>
<br></div>
Can you point out why it is failing? It seems to be working here. Unfortunately, your fix will end up killing any cat process in the system, which is not desirable.</blockquote><div><br></div><div>My understanding is that the script's process id ($$) is not the same on each run. So the second run of the script fail to kill the cat processes created by the first run of the script. Is this reasonable?</div>
<div><br></div><div>As for the potential side effect of killing other cat processes, I haven't figure out how to resolve this...</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- "cat /dev/crbif0rb0c${i}ttyS0 | grep . --line-buffered &" in the for<br>
loop can not display the<br>
outputs properly: only empty lines are printed.<br>
</blockquote>
<br></div>
Thanks for fixing this one. I'm not sure why it prints only empty lines in your case, though I see no problem applying your fix.</blockquote><div><br></div><div>I don't know why it fails here either. I tried stackoverflow[1][2] by get no useful answer. Personally, I suspect that there are some control bytes in the UART stream that fools grep, but I'm not sure...</div>
<div><br></div><div>[1] <a href="http://stackoverflow.com/questions/10429434/concurrent-uart-output-with-line-buffered">http://stackoverflow.com/questions/10429434/concurrent-uart-output-with-line-buffered</a></div><div>
[2] <a href="http://stackoverflow.com/questions/10443704/line-buffered-cat">http://stackoverflow.com/questions/10443704/line-buffered-cat</a></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888"><br>
<br>
Simon<br>
<br>
</font></span></blockquote></div><br>