Reading serial using BASH
Hello,
I am having a problem reading serial with bash. I just want it to read a single response (two ints send in the form 15 21\n) then exit. So far the code closest to working is but that prints forever. The second code does not return the values. [dan.b@dan-laptop bin]$ cat /dev/ttyUSB1 | while read i j LINE; do echo -n "$i,";echo $j; done 15,21 15,21 15,21 15,21 15,21 15,21 ^C [dan.b@dan-laptop bin]$ cat /dev/ttyUSB1 | read i j LINE;echo -n "$i,";echo $j , [dan.b@dan-laptop bin]$ Thanks Dan.b |
If anyone else has the same problem I just used
head -n 1 instead and outputted a newline char when sending |
All times are GMT -5. The time now is 09:05 AM. |