Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Serial Port as Input

Status
Not open for further replies.

gameman

Programmer
Oct 13, 1999
1
US
I'm new to AWK, can someone tell/show (example would be nice) me how to use a serial port an an input to awk. I would like to use AWK to sort the data on this port.
 
That is not an AWK question. AWK either reads from standard input or from a file you specify on the command line. You can reference a serial port both ways.<br>
Awk will close out as soon as it sees eof though, so a serial port without data on it will cause awk to prematurely close.<br>
You might be able to get around the lack of constant data on a serial port by using a construct like this:<br>
tail -f /dev/ttyXX ¦ awk -f &quot;myawkscript&quot;<br>
since tail will leave the pipe open even if nothing is on /dev/ttyXX, which represents your serial port device.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top