linux chat command

 

介紹

Automated conversational script with a modem


Usage

 

chat [ options ] script

Options

-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.

-e    

Start with the echo option turned on.

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

script

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.

Example

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