740 lines
22 KiB
HTML
740 lines
22 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of CHAT</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>CHAT</H1>
|
|
Section: Maintenance Commands (8)<BR>Updated: 22 May 1999<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
chat - Automated conversational script with a modem
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>chat</B>
|
|
|
|
[
|
|
<I>options</I>
|
|
|
|
]
|
|
<I>script</I>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
The <I>chat</I> program defines a conversational exchange between the
|
|
computer and the modem. Its primary purpose is to establish the
|
|
connection between the Point-to-Point Protocol Daemon (<I>pppd</I>) and
|
|
the remote's <I>pppd</I> process.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-f </B><I><chat file></I>
|
|
|
|
<DD>
|
|
Read the chat script from the chat <I>file</I>. The use of this option
|
|
is mutually exclusive with the chat script parameters. The user must
|
|
have read access to the file. Multiple lines are permitted in the
|
|
file. Space or horizontal tab characters should be used to separate
|
|
the strings.
|
|
<DT id="2"><B>-t </B><I><timeout></I>
|
|
|
|
<DD>
|
|
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. An alternate reply may be sent or the script will fail if there
|
|
is no alternate reply string. A failed script will cause the
|
|
<I>chat</I> program to terminate with a non-zero error code. You can
|
|
also use the TIMEOUT string in order to specify the timeout.
|
|
<DT id="3"><B>-r </B><I><report file></I>
|
|
|
|
<DD>
|
|
Set the file for output of the report strings. If you use the keyword
|
|
<I>REPORT</I>, the resulting strings are written to this file. If this
|
|
option is not used and you still use <I>REPORT</I> keywords, the
|
|
<I>stderr</I> file is used for the report strings.
|
|
<DT id="4"><B>-e</B>
|
|
|
|
<DD>
|
|
Start with the echo option turned on. Echoing may also be turned on
|
|
or off at specific points in the chat script by using the <I>ECHO</I>
|
|
keyword. When echoing is enabled, all output from the modem is echoed
|
|
to <I>stderr</I>.
|
|
<DT id="5"><B>-E</B>
|
|
|
|
<DD>
|
|
Enables environment variable substitution within chat scripts using the
|
|
standard <I>$xxx</I> syntax.
|
|
<DT id="6"><B>-v</B>
|
|
|
|
<DD>
|
|
Request that the <I>chat</I> script be executed in a verbose mode. The
|
|
<I>chat</I> program will then log the execution state of the chat
|
|
script as well as all text received from the modem and the output
|
|
strings sent to the modem. The default is to log through the SYSLOG;
|
|
the logging method may be altered with the -S and -s flags.
|
|
<DT id="7"><B>-V</B>
|
|
|
|
<DD>
|
|
Request that the <I>chat</I> script be executed in a stderr verbose
|
|
mode. The <I>chat</I> program will then log all text received from the
|
|
modem and the output strings sent to the modem to the stderr device. This
|
|
device is usually the local console at the station running the chat or
|
|
pppd program.
|
|
<DT id="8"><B>-s</B>
|
|
|
|
<DD>
|
|
Use stderr. All log messages from '-v' and all error messages will be
|
|
sent to stderr.
|
|
<DT id="9"><B>-S</B>
|
|
|
|
<DD>
|
|
Do not use the SYSLOG. By default, error messages are sent to the
|
|
SYSLOG. The use of -S will prevent both log messages from '-v' and
|
|
error messages from being sent to the SYSLOG.
|
|
<DT id="10"><B>-T </B><I><phone number></I>
|
|
|
|
<DD>
|
|
Pass in an arbitrary string, usually a phone number, that will be
|
|
substituted for the \T substitution metacharacter in a send string.
|
|
<DT id="11"><B>-U </B><I><phone number 2></I>
|
|
|
|
<DD>
|
|
Pass in a second string, usually a phone number, that will be
|
|
substituted for the \U substitution metacharacter in a send string.
|
|
This is useful when dialing an ISDN terminal adapter that requires two
|
|
numbers.
|
|
<DT id="12"><B>script</B>
|
|
|
|
<DD>
|
|
If the script is not specified in a file with the <I>-f</I> option then
|
|
the script is included as parameters to the <I>chat</I> program.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>CHAT SCRIPT</H2>
|
|
|
|
<P>
|
|
|
|
The <I>chat</I> script defines the communications.
|
|
<P>
|
|
|
|
A script consists of one or more "expect-send" pairs of strings,
|
|
separated by spaces, with an optional "subexpect-subsend" string pair,
|
|
separated by a dash as in the following example:
|
|
<DL COMPACT>
|
|
<DT id="13"><DD>
|
|
ogin:-BREAK-ogin: ppp ssword: hello2u2
|
|
</DL>
|
|
<P>
|
|
|
|
This line indicates that the <I>chat</I> program should expect the string
|
|
"ogin:". If it fails to receive a login prompt within the time interval
|
|
allotted, it is to send a break sequence to the remote and then expect the
|
|
string "ogin:". If the first "ogin:" is received then the break sequence is
|
|
not generated.
|
|
<P>
|
|
|
|
Once it received the login prompt the <I>chat</I> program will send the
|
|
string ppp and then expect the prompt "ssword:". When it receives the
|
|
prompt for the password, it will send the password hello2u2.
|
|
<P>
|
|
|
|
A carriage return is normally sent following the reply string. It is not
|
|
expected in the "expect" string unless it is specifically requested by using
|
|
the \r character sequence.
|
|
<P>
|
|
|
|
The expect sequence should contain only what is needed to identify the
|
|
string. Since it is normally stored on a disk file, it should not contain
|
|
variable information. It is generally not acceptable to look for time
|
|
strings, network identification strings, or other variable pieces of data as
|
|
an expect string.
|
|
<P>
|
|
|
|
To help correct for characters which may be corrupted during the initial
|
|
sequence, look for the string "ogin:" rather than "login:". It is possible
|
|
that the leading "l" character may be received in error and you may never
|
|
find the string even though it was sent by the system. For this reason,
|
|
scripts look for "ogin:" rather than "login:" and "ssword:" rather than
|
|
"password:".
|
|
<P>
|
|
|
|
A very simple script might look like this:
|
|
<DL COMPACT>
|
|
<DT id="14"><DD>
|
|
ogin: ppp ssword: hello2u2
|
|
</DL>
|
|
<P>
|
|
|
|
In other words, expect ....ogin:, send ppp, expect ...ssword:, send hello2u2.
|
|
<P>
|
|
|
|
In actual practice, simple scripts are rare. At the vary least, you
|
|
should include sub-expect sequences should the original string not be
|
|
received. For example, consider the following script:
|
|
<DL COMPACT>
|
|
<DT id="15"><DD>
|
|
ogin:--ogin: ppp ssword: hello2u2
|
|
</DL>
|
|
<P>
|
|
|
|
This would be a better script than the simple one used earlier. This would look
|
|
for the same login: prompt, however, if one was not received, a single
|
|
return sequence is sent and then it will look for login: again. Should line
|
|
noise obscure the first login prompt then sending the empty line will
|
|
usually generate a login prompt again.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>COMMENTS</H2>
|
|
|
|
Comments can be embedded in the chat script. A comment is a line which
|
|
starts with the <B>#</B> (hash) character in column 1. Such comment
|
|
lines are just ignored by the chat program. If a '#' character is to
|
|
be expected as the first character of the expect sequence, you should
|
|
quote the expect string.
|
|
If you want to wait for a prompt that starts with a # (hash)
|
|
character, you would have to write something like this:
|
|
<DL COMPACT>
|
|
<DT id="16"><DD>
|
|
# Now wait for the prompt and send logout string
|
|
<BR>
|
|
|
|
'# ' logout
|
|
</DL>
|
|
<P>
|
|
|
|
<P>
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SENDING DATA FROM A FILE</H2>
|
|
|
|
If the string to send starts with an at sign (@), the rest of the
|
|
string is taken to be the name of a file to read to get the string to
|
|
send. If the last character of the data read is a newline, it is
|
|
removed. The file can be a named pipe (or fifo) instead of a regular
|
|
file. This provides a way for <B>chat</B> to communicate with another
|
|
program, for example, a program to prompt the user and receive a
|
|
password typed in.
|
|
<P>
|
|
|
|
<P>
|
|
<A NAME="lbAI"> </A>
|
|
<H2>ABORT STRINGS</H2>
|
|
|
|
Many modems will report the status of the call as a string. These
|
|
strings may be <B>CONNECTED</B> or <B>NO CARRIER</B> or <B>BUSY</B>. It
|
|
is often desirable to terminate the script should the modem fail to
|
|
connect to the remote. The difficulty is that a script would not know
|
|
exactly which modem string it may receive. On one attempt, it may
|
|
receive <B>BUSY</B> while the next time it may receive <B>NO CARRIER</B>.
|
|
<P>
|
|
|
|
These "abort" strings may be specified in the script using the <I>ABORT</I>
|
|
sequence. It is written in the script as in the following example:
|
|
<DL COMPACT>
|
|
<DT id="17"><DD>
|
|
ABORT BUSY ABORT 'NO CARRIER' '' ATZ OK ATDT5551212 CONNECT
|
|
</DL>
|
|
<P>
|
|
|
|
This sequence will expect nothing; and then send the string ATZ. The
|
|
expected response to this is the string <I>OK</I>. When it receives <I>OK</I>,
|
|
the string ATDT5551212 to dial the telephone. The expected string is
|
|
<I>CONNECT</I>. If the string <I>CONNECT</I> is received the remainder of the
|
|
script is executed. However, should the modem find a busy telephone, it will
|
|
send the string <I>BUSY</I>. This will cause the string to match the abort
|
|
character sequence. The script will then fail because it found a match to
|
|
the abort string. If it received the string <I>NO CARRIER</I>, it will abort
|
|
for the same reason. Either string may be received. Either string will
|
|
terminate the <I>chat</I> script.
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>CLR_ABORT STRINGS</H2>
|
|
|
|
This sequence allows for clearing previously set <B>ABORT</B> strings.
|
|
<B>ABORT</B> strings are kept in an array of a pre-determined size (at
|
|
compilation time); <B>CLR_ABORT</B> will reclaim the space for cleared
|
|
entries so that new strings can use that space.
|
|
<A NAME="lbAK"> </A>
|
|
<H2>SAY STRINGS</H2>
|
|
|
|
The <B>SAY</B> directive allows the script to send strings to the user
|
|
at the terminal via standard error. If <B>chat</B> is being run by
|
|
pppd, and pppd is running as a daemon (detached from its controlling
|
|
terminal), standard error will normally be redirected to the file
|
|
/etc/ppp/connect-errors.
|
|
<P>
|
|
|
|
<B>SAY</B> strings must be enclosed in single or double quotes. If
|
|
carriage return and line feed are needed in the string to be output,
|
|
you must explicitly add them to your string.
|
|
<P>
|
|
|
|
The SAY strings could be used to give progress messages in sections of
|
|
the script where you want to have 'ECHO OFF' but still let the user
|
|
know what is happening. An example is:
|
|
<DL COMPACT>
|
|
<DT id="18"><DD>
|
|
ABORT BUSY
|
|
<BR>
|
|
|
|
ECHO OFF
|
|
<BR>
|
|
|
|
SAY "Dialling your ISP...\n"
|
|
<BR>
|
|
|
|
'' ATDT5551212
|
|
<BR>
|
|
|
|
TIMEOUT 120
|
|
<BR>
|
|
|
|
SAY "Waiting up to 2 minutes for connection ... "
|
|
<BR>
|
|
|
|
CONNECT ''
|
|
<BR>
|
|
|
|
SAY "Connected, now logging in ...\n"
|
|
<BR>
|
|
|
|
ogin: account
|
|
<BR>
|
|
|
|
ssword: pass
|
|
<BR>
|
|
|
|
$ \c
|
|
<BR>
|
|
|
|
SAY "Logged in OK ...\n"
|
|
<I>etc ...</I>
|
|
</DL>
|
|
<P>
|
|
|
|
This sequence will only present the SAY strings to the user and all
|
|
the details of the script will remain hidden. For example, if the
|
|
above script works, the user will see:
|
|
<DL COMPACT>
|
|
<DT id="19"><DD>
|
|
Dialling your ISP...
|
|
<BR>
|
|
|
|
Waiting up to 2 minutes for connection ... Connected, now logging in ...
|
|
<BR>
|
|
|
|
Logged in OK ...
|
|
</DL>
|
|
<P>
|
|
|
|
<P>
|
|
<A NAME="lbAL"> </A>
|
|
<H2>REPORT STRINGS</H2>
|
|
|
|
A <B>report</B> string is similar to the ABORT string. The difference
|
|
is that the strings, and all characters to the next control character
|
|
such as a carriage return, are written to the report file.
|
|
<P>
|
|
|
|
The report strings may be used to isolate the transmission rate of the
|
|
modem's connect string and return the value to the chat user. The
|
|
analysis of the report string logic occurs in conjunction with the
|
|
other string processing such as looking for the expect string. The use
|
|
of the same string for a report and abort sequence is probably not
|
|
very useful, however, it is possible.
|
|
<P>
|
|
|
|
The report strings to no change the completion code of the program.
|
|
<P>
|
|
|
|
These "report" strings may be specified in the script using the <I>REPORT</I>
|
|
sequence. It is written in the script as in the following example:
|
|
<DL COMPACT>
|
|
<DT id="20"><DD>
|
|
REPORT CONNECT ABORT BUSY '' ATDT5551212 CONNECT '' ogin: account
|
|
</DL>
|
|
<P>
|
|
|
|
This sequence will expect nothing; and then send the string
|
|
ATDT5551212 to dial the telephone. The expected string is
|
|
<I>CONNECT</I>. If the string <I>CONNECT</I> is received the remainder
|
|
of the script is executed. In addition the program will write to the
|
|
expect-file the string "CONNECT" plus any characters which follow it
|
|
such as the connection rate.
|
|
<A NAME="lbAM"> </A>
|
|
<H2>CLR_REPORT STRINGS</H2>
|
|
|
|
This sequence allows for clearing previously set <B>REPORT</B> strings.
|
|
<B>REPORT</B> strings are kept in an array of a pre-determined size (at
|
|
compilation time); <B>CLR_REPORT</B> will reclaim the space for cleared
|
|
entries so that new strings can use that space.
|
|
<A NAME="lbAN"> </A>
|
|
<H2>ECHO</H2>
|
|
|
|
The echo options controls whether the output from the modem is echoed
|
|
to <I>stderr</I>. This option may be set with the <I>-e</I> option, but
|
|
it can also be controlled by the <I>ECHO</I> keyword. The "expect-send"
|
|
pair <I>ECHO</I> <I>ON</I> enables echoing, and <I>ECHO</I> <I>OFF</I>
|
|
disables it. With this keyword you can select which parts of the
|
|
conversation should be visible. For instance, with the following
|
|
script:
|
|
<DL COMPACT>
|
|
<DT id="21"><DD>
|
|
ABORT 'BUSY'
|
|
<BR>
|
|
|
|
ABORT 'NO CARRIER'
|
|
<BR>
|
|
|
|
'' ATZ
|
|
<BR>
|
|
|
|
OK\r\n ATD1234567
|
|
<BR>
|
|
|
|
\r\n \c
|
|
<BR>
|
|
|
|
ECHO ON
|
|
<BR>
|
|
|
|
CONNECT \c
|
|
<BR>
|
|
|
|
ogin: account
|
|
</DL>
|
|
<P>
|
|
|
|
all output resulting from modem configuration and dialing is not visible,
|
|
but starting with the <I>CONNECT</I> (or <I>BUSY</I>) message, everything
|
|
will be echoed.
|
|
<A NAME="lbAO"> </A>
|
|
<H2>HANGUP</H2>
|
|
|
|
The HANGUP options control whether a modem hangup should be considered
|
|
as an error or not. This option is useful in scripts for dialling
|
|
systems which will hang up and call your system back. The HANGUP
|
|
options can be <B>ON</B> or <B>OFF</B>.
|
|
<BR>
|
|
|
|
When HANGUP is set OFF and the modem hangs up (e.g., after the first
|
|
stage of logging in to a callback system), <B>chat</B> will continue
|
|
running the script (e.g., waiting for the incoming call and second
|
|
stage login prompt). As soon as the incoming call is connected, you
|
|
should use the <B>HANGUP ON</B> directive to reinstall normal hang up
|
|
signal behavior. Here is an (simple) example script:
|
|
<DL COMPACT>
|
|
<DT id="22"><DD>
|
|
ABORT 'BUSY'
|
|
<BR>
|
|
|
|
'' ATZ
|
|
<BR>
|
|
|
|
OK\r\n ATD1234567
|
|
<BR>
|
|
|
|
\r\n \c
|
|
<BR>
|
|
|
|
CONNECT \c
|
|
<BR>
|
|
|
|
'Callback login:' call_back_ID
|
|
<BR>
|
|
|
|
HANGUP OFF
|
|
<BR>
|
|
|
|
ABORT "Bad Login"
|
|
<BR>
|
|
|
|
'Callback Password:' Call_back_password
|
|
<BR>
|
|
|
|
TIMEOUT 120
|
|
<BR>
|
|
|
|
CONNECT \c
|
|
<BR>
|
|
|
|
HANGUP ON
|
|
<BR>
|
|
|
|
ABORT "NO CARRIER"
|
|
<BR>
|
|
|
|
ogin:--BREAK--ogin: real_account
|
|
<BR>
|
|
|
|
<I>etc ...</I>
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="lbAP"> </A>
|
|
<H2>TIMEOUT</H2>
|
|
|
|
The initial timeout value is 45 seconds. This may be changed using the <B>-t</B>
|
|
parameter. You can also specify "TIMEOUT 0".
|
|
<P>
|
|
|
|
To change the timeout value for the next expect string, the following
|
|
example may be used:
|
|
<DL COMPACT>
|
|
<DT id="23"><DD>
|
|
ATZ OK ATDT5551212 CONNECT TIMEOUT 10 ogin:--ogin: TIMEOUT 5 assword: hello2u2
|
|
</DL>
|
|
<P>
|
|
|
|
This will change the timeout to 10 seconds when it expects the login:
|
|
prompt. The timeout is then changed to 5 seconds when it looks for the
|
|
password prompt.
|
|
<P>
|
|
|
|
The timeout, once changed, remains in effect until it is changed again.
|
|
<A NAME="lbAQ"> </A>
|
|
<H2>SENDING EOT</H2>
|
|
|
|
The special reply string of <I>EOT</I> indicates that the chat program
|
|
should send an EOT character to the remote. This is normally the
|
|
End-of-file character sequence. A return character is not sent
|
|
following the EOT.
|
|
The EOT sequence may be embedded into the send string using the
|
|
sequence <I>^D</I>.
|
|
<A NAME="lbAR"> </A>
|
|
<H2>GENERATING BREAK</H2>
|
|
|
|
The special reply string of <I>BREAK</I> will cause a break condition
|
|
to be sent. The break is a special signal on the transmitter. The
|
|
normal processing on the receiver is to change the transmission rate.
|
|
It may be used to cycle through the available transmission rates on
|
|
the remote until you are able to receive a valid login prompt.
|
|
The break sequence may be embedded into the send string using the
|
|
<I>\K</I> sequence.
|
|
<A NAME="lbAS"> </A>
|
|
<H2>ESCAPE SEQUENCES</H2>
|
|
|
|
The expect and reply strings may contain escape sequences. All of the
|
|
sequences are legal in the reply string. Many are legal in the expect.
|
|
Those which are not valid in the expect sequence are so indicated.
|
|
<DL COMPACT>
|
|
<DT id="24"><B>''</B>
|
|
|
|
<DD>
|
|
Expects or sends a null string. If you send a null string then it will still
|
|
send the return character. This sequence may either be a pair of apostrophe
|
|
or quote characters.
|
|
<DT id="25"><B>\b</B>
|
|
|
|
<DD>
|
|
represents a backspace character.
|
|
<DT id="26"><B>\c</B>
|
|
|
|
<DD>
|
|
Suppresses the newline at the end of the reply string. This is the only
|
|
method to send a string without a trailing return character. It must
|
|
be at the end of the send string. For example,
|
|
the sequence hello\c will simply send the characters h, e, l, l, o.
|
|
<I>(not valid in expect.)</I>
|
|
|
|
<DT id="27"><B>\d</B>
|
|
|
|
<DD>
|
|
Delay for one second. The program uses <A HREF="/cgi-bin/man/man2html?1+sleep">sleep</A>(1) which will delay to a
|
|
maximum of one second.
|
|
<I>(not valid in expect.)</I>
|
|
|
|
<DT id="28"><B>\K</B>
|
|
|
|
<DD>
|
|
Insert a BREAK
|
|
<I>(not valid in expect.)</I>
|
|
|
|
<DT id="29"><B>\n</B>
|
|
|
|
<DD>
|
|
Send a newline or linefeed character.
|
|
<DT id="30"><B>\N</B>
|
|
|
|
<DD>
|
|
Send a null character. The same sequence may be represented by \0.
|
|
<I>(not valid in expect.)</I>
|
|
|
|
<DT id="31"><B>\p</B>
|
|
|
|
<DD>
|
|
Pause for a fraction of a second. The delay is 1/10th of a second.
|
|
<I>(not valid in expect.)</I>
|
|
|
|
<DT id="32"><B>\q</B>
|
|
|
|
<DD>
|
|
Suppress writing the string to the SYSLOG file. The string ?????? is
|
|
written to the log in its place.
|
|
<I>(not valid in expect.)</I>
|
|
|
|
<DT id="33"><B>\r</B>
|
|
|
|
<DD>
|
|
Send or expect a carriage return.
|
|
<DT id="34"><B>\s</B>
|
|
|
|
<DD>
|
|
Represents a space character in the string. This may be used when it
|
|
is not desirable to quote the strings which contains spaces. The
|
|
sequence 'HI TIM' and HI\sTIM are the same.
|
|
<DT id="35"><B>\t</B>
|
|
|
|
<DD>
|
|
Send or expect a tab character.
|
|
<DT id="36"><B>\T</B>
|
|
|
|
<DD>
|
|
Send the phone number string as specified with the <I>-T</I> option
|
|
<I>(not valid in expect.)</I>
|
|
|
|
<DT id="37"><B>\U</B>
|
|
|
|
<DD>
|
|
Send the phone number 2 string as specified with the <I>-U</I> option
|
|
<I>(not valid in expect.)</I>
|
|
|
|
<DT id="38"><B>\\</B>
|
|
|
|
<DD>
|
|
Send or expect a backslash character.
|
|
<DT id="39"><B>\ddd</B>
|
|
|
|
<DD>
|
|
Collapse the octal digits (ddd) into a single ASCII character and send that
|
|
character.
|
|
<I>(some characters are not valid in expect.)</I>
|
|
|
|
<DT id="40"><B>^C</B>
|
|
|
|
<DD>
|
|
Substitute the sequence with the control character represented by C.
|
|
For example, the character DC1 (17) is shown as ^Q.
|
|
<I>(some characters are not valid in expect.)</I>
|
|
|
|
</DL>
|
|
<A NAME="lbAT"> </A>
|
|
<H2>ENVIRONMENT VARIABLES</H2>
|
|
|
|
Environment variables are available within chat scripts, if the <I>-E</I>
|
|
option was specified in the command line. The metacharacter <I>$</I> is used
|
|
to introduce the name of the environment variable to substitute. If the
|
|
substitution fails, because the requested environment variable is not set,
|
|
<I>nothing</I> is replaced for the variable.
|
|
<A NAME="lbAU"> </A>
|
|
<H2>TERMINATION CODES</H2>
|
|
|
|
The <I>chat</I> program will terminate with the following completion
|
|
codes.
|
|
<DL COMPACT>
|
|
<DT id="41"><B>0</B>
|
|
|
|
<DD>
|
|
The normal termination of the program. This indicates that the script
|
|
was executed without error to the normal conclusion.
|
|
<DT id="42"><B>1</B>
|
|
|
|
<DD>
|
|
One or more of the parameters are invalid or an expect string was too
|
|
large for the internal buffers. This indicates that the program as not
|
|
properly executed.
|
|
<DT id="43"><B>2</B>
|
|
|
|
<DD>
|
|
An error occurred during the execution of the program. This may be due
|
|
to a read or write operation failing for some reason or chat receiving
|
|
a signal such as SIGINT.
|
|
<DT id="44"><B>3</B>
|
|
|
|
<DD>
|
|
A timeout event occurred when there was an <I>expect</I> string without
|
|
having a "-subsend" string. This may mean that you did not program the
|
|
script correctly for the condition or that some unexpected event has
|
|
occurred and the expected string could not be found.
|
|
<DT id="45"><B>4</B>
|
|
|
|
<DD>
|
|
The first string marked as an <I>ABORT</I> condition occurred.
|
|
<DT id="46"><B>5</B>
|
|
|
|
<DD>
|
|
The second string marked as an <I>ABORT</I> condition occurred.
|
|
<DT id="47"><B>6</B>
|
|
|
|
<DD>
|
|
The third string marked as an <I>ABORT</I> condition occurred.
|
|
<DT id="48"><B>7</B>
|
|
|
|
<DD>
|
|
The fourth string marked as an <I>ABORT</I> condition occurred.
|
|
<DT id="49"><B>...</B>
|
|
|
|
<DD>
|
|
The other termination codes are also strings marked as an <I>ABORT</I>
|
|
condition.
|
|
</DL>
|
|
<P>
|
|
|
|
Using the termination code, it is possible to determine which event
|
|
terminated the script. It is possible to decide if the string "BUSY"
|
|
was received from the modem as opposed to "NO DIAL TONE". While the
|
|
first event may be retried, the second will probably have little
|
|
chance of succeeding during a retry.
|
|
<A NAME="lbAV"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
Additional information about <I>chat</I> scripts may be found with UUCP
|
|
documentation. The <I>chat</I> script was taken from the ideas proposed
|
|
by the scripts used by the <I>uucico</I> program.
|
|
<P>
|
|
|
|
<A HREF="/cgi-bin/man/man2html?1+uucico">uucico</A>(1), <A HREF="/cgi-bin/man/man2html?1+uucp">uucp</A>(1)
|
|
<A NAME="lbAW"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
The <I>chat</I> program is in public domain. This is not the GNU public
|
|
license. If it breaks then you get to keep both pieces.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="50"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="51"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="52"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="53"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="54"><A HREF="#lbAF">CHAT SCRIPT</A><DD>
|
|
<DT id="55"><A HREF="#lbAG">COMMENTS</A><DD>
|
|
<DT id="56"><A HREF="#lbAH">SENDING DATA FROM A FILE</A><DD>
|
|
<DT id="57"><A HREF="#lbAI">ABORT STRINGS</A><DD>
|
|
<DT id="58"><A HREF="#lbAJ">CLR_ABORT STRINGS</A><DD>
|
|
<DT id="59"><A HREF="#lbAK">SAY STRINGS</A><DD>
|
|
<DT id="60"><A HREF="#lbAL">REPORT STRINGS</A><DD>
|
|
<DT id="61"><A HREF="#lbAM">CLR_REPORT STRINGS</A><DD>
|
|
<DT id="62"><A HREF="#lbAN">ECHO</A><DD>
|
|
<DT id="63"><A HREF="#lbAO">HANGUP</A><DD>
|
|
<DT id="64"><A HREF="#lbAP">TIMEOUT</A><DD>
|
|
<DT id="65"><A HREF="#lbAQ">SENDING EOT</A><DD>
|
|
<DT id="66"><A HREF="#lbAR">GENERATING BREAK</A><DD>
|
|
<DT id="67"><A HREF="#lbAS">ESCAPE SEQUENCES</A><DD>
|
|
<DT id="68"><A HREF="#lbAT">ENVIRONMENT VARIABLES</A><DD>
|
|
<DT id="69"><A HREF="#lbAU">TERMINATION CODES</A><DD>
|
|
<DT id="70"><A HREF="#lbAV">SEE ALSO</A><DD>
|
|
<DT id="71"><A HREF="#lbAW">COPYRIGHT</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:11 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|