Hello all,
We are using SOM9331 module and we need to read data from the serial port and write it to a text file.We have written script in /etc/hotplug.d/tty to read data.
Script:
#!/bin/sh
stty -F /dev/ttyATH0 9600
cat /dev/ttyATH0 > /status.txt
When it receives serial data it appending the data at the end of the file instead of overwriting the content of the file.can anyone let me know how to overwrite the content of file instead of appending to it.
Thanks!!