<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><div>cat /dev/your_serial_port > some_file &</div><div>sleep X</div><div>kill $!</div><div><br></div><div>Valery</div><div><br></div>--- On <b>Thu, 6/10/10, Ori Idan <i><ori@helicontech.co.il></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Ori Idan <ori@helicontech.co.il><br>Subject: cat command with timeout<br>To: "IGLU Mailing list" <linux-il@cs.huji.ac.il><br>Date: Thursday, June 10, 2010, 10:13 AM<br><br><div id="yiv894553231"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">I have to read lines from serial port, I thought to read them using 'cat' <br>however, since the other unit connected to the serial port, might malfunction and not send anything, I need a timeout to stop reading after few seconds.<br>
Does someone know of an alternative to cat with timeout?<br><br>-- <br>Ori Idan<br> <br></div>
</div><br></div>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>Linux-il mailing list<br><a ymailto="mailto:Linux-il@cs.huji.ac.il" href="/mc/compose?to=Linux-il@cs.huji.ac.il">Linux-il@cs.huji.ac.il</a><br><a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br></div></blockquote></td></tr></table><br>