Re: Re: [Bash script] How can I read a tty device?

2013-05-17 Thread Jasper Noe
Ah, I get it. 'read -n1' is the way. On Fri, May 17, 2013 at 12:19 PM, Magicloud Magiclouds wrote: Hi, Say I have device /dev/ttyACM0. If I `stty -F /dev/ttyACM0 raw`, then `cat /dev/ttyACM0` in one term, and `echo -e "QUERYCOMMAND" > /dev/ttyACM0` in another term. I would get the data in

Re: [Bash script] How can I read a tty device?

2013-05-17 Thread Magicloud Magiclouds
Ah, I get it. 'read -n1' is the way. On Fri, May 17, 2013 at 12:19 PM, Magicloud Magiclouds < magicloud.magiclo...@gmail.com> wrote: > Hi, > > Say I have device /dev/ttyACM0. If I `stty -F /dev/ttyACM0 raw`, then > `cat /dev/ttyACM0` in one term, and `echo -e "QUERYCOMMAND" > /dev/ttyACM0` > i

[Bash script] How can I read a tty device?

2013-05-16 Thread Magicloud Magiclouds
Hi, Say I have device /dev/ttyACM0. If I `stty -F /dev/ttyACM0 raw`, then `cat /dev/ttyACM0` in one term, and `echo -e "QUERYCOMMAND" > /dev/ttyACM0` in another term. I would get the data in first term. But if echo first, then cat. The data seemed lost. Cat would not get anything. So I think