Bash script: save stream from Serial Port (/dev/ttyUSB0) to file until a specific input (e.g. eof) appears

心已入冬 提交于 2019-11-30 20:51:46

Try 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!