I need a bash script to read the data stream from a Serial Port (RS232 to USB adapter - Port: /dev/ttyUSB0). The data should be stored line by line in a file until a specifi
Try awk(1):
awk(1)
awk ` /EOF/ {exit;} {print;}` < /dev/ttyUSB0 > file.txt
This stops when it sees the line EOF and prints everything else to file.txt
EOF
file.txt