linux chat command



Automated conversational script with a modem



chat [ options ] script


-t <timeout>

Set the timeout for the expected string to be received.

If the string is not received within the time limit then the reply string is not sent.


Start with the echo option turned on.

When echoing is enabled, all output from the modem is echoed to stderr.


A script consists of one or more "expect-send" pairs of  strings,  separated  by  spaces

expect send expect send ...


A  carriage return is normally sent following the reply string.

It is not expected in the  "expect" string


A comment is a line which starts with the  #


script If the script is not specified in a file with the -f option

then the script is included as parameters to the chat program.


chat -t 3 -e '' 'AT+CSQ' OK >> /dev/ttyACM0 < /dev/ttyACM0