Deleted Added
full compact
chat.8 (5058) chat.8 (11990)
1.\" -*- nroff -*-
2.\" manual page [] for chat 1.8
3.\" $Id: chat.8,v 1.1.1.1 1994/11/12 05:25:32 lars Exp $
4.\" SH section heading
5.\" SS subsection heading
6.\" LP paragraph
7.\" IP indented paragraph
8.\" TP hanging label
1.\" -*- nroff -*-
2.\" manual page [] for chat 1.8
3.\" $Id: chat.8,v 1.1.1.1 1994/11/12 05:25:32 lars Exp $
4.\" SH section heading
5.\" SS subsection heading
6.\" LP paragraph
7.\" IP indented paragraph
8.\" TP hanging label
9.TH CHAT 8 "17 April 1994" "Chat Version 1.8"
9.TH CHAT 8 "5 May 1995" "Chat Version 1.9"
10.SH NAME
11chat \- Automated conversational script with a modem
12.SH SYNOPSIS
13.B chat
14[
15.I options
16]
17.I script

--- 7 unchanged lines hidden (view full) ---

25.TP
26.B -f \fI<chat file>
27Read the chat script from the chat \fIfile\fR. The use of this option
28is mutually exclusive with the chat script parameters. The user must
29have read access to the file. Multiple lines are permitted in the
30file. Space or horizontal tab characters should be used to separate
31the strings.
32.TP
10.SH NAME
11chat \- Automated conversational script with a modem
12.SH SYNOPSIS
13.B chat
14[
15.I options
16]
17.I script

--- 7 unchanged lines hidden (view full) ---

25.TP
26.B -f \fI<chat file>
27Read the chat script from the chat \fIfile\fR. The use of this option
28is mutually exclusive with the chat script parameters. The user must
29have read access to the file. Multiple lines are permitted in the
30file. Space or horizontal tab characters should be used to separate
31the strings.
32.TP
33.B -l \fI<lock file>
34Perform the UUCP style locking using the indicated lock file.
35.IP
36If the file could not be created then the \fIchat\fR program will
37fail. The lock file will be deleted only if the \fIchat\fR program
38fails to perform the script for any reason. If the script is
39successful the lock file will be left on the disk. It is expected that
40the lock file will be deleted when the \fIpppd\fR process no longer
41wishes to use the serial device.
42.IP
43The use of a lock file with
44.I chat
45and
46\fIpppd\fR\'s
47.I lock
48option should not be used at the same time. They are mutually
49exclusive options and will cause one or the other program to fail to
50achieve the required lock if you use both.
51.TP
52.B -t \fI<timeout>
53Set the timeout for the expected string to be received. If the string
54is not received within the time limit then the reply string is not
55sent. An alternate reply may be sent or the script will fail if there
56is no alternate reply string. A failed script will cause the
57\fIchat\fR program to terminate with a non-zero error code.
58.TP
33.B -t \fI<timeout>
34Set the timeout for the expected string to be received. If the string
35is not received within the time limit then the reply string is not
36sent. An alternate reply may be sent or the script will fail if there
37is no alternate reply string. A failed script will cause the
38\fIchat\fR program to terminate with a non-zero error code.
39.TP
40.B -r \fI<report file>
41Set the file for output of the report strings. If you use the keyword
42\fIREPORT\fR, the resulting strings are written to this file. If this
43option is not used and you still use \fIREPORT\fR keywords, the
44\fIstderr\fR file is used for the report strings.
45.TP
59.B -v
60Request that the \fIchat\fR script be executed in a verbose mode. The
61\fIchat\fR program will then log all text received from the modem and
62the output strings which it sends to the SYSLOG.
63.TP
64.B script
65If the script is not specified in a file with the \fI-f\fR option then
66the script is included as parameters to the \fIchat\fR program.

--- 8 unchanged lines hidden (view full) ---

75ogin:-BREAK-ogin: ppp ssword: hello2u2
76.LP
77This line indicates that the \fIchat\fR program should expect the string
78"ogin:". If it fails to receive a login prompt within the time interval
79allotted, it is to send a break sequence to the remote and then expect the
80string "ogin:". If the first "ogin:" is received then the break sequence is
81not generated.
82.LP
46.B -v
47Request that the \fIchat\fR script be executed in a verbose mode. The
48\fIchat\fR program will then log all text received from the modem and
49the output strings which it sends to the SYSLOG.
50.TP
51.B script
52If the script is not specified in a file with the \fI-f\fR option then
53the script is included as parameters to the \fIchat\fR program.

--- 8 unchanged lines hidden (view full) ---

62ogin:-BREAK-ogin: ppp ssword: hello2u2
63.LP
64This line indicates that the \fIchat\fR program should expect the string
65"ogin:". If it fails to receive a login prompt within the time interval
66allotted, it is to send a break sequence to the remote and then expect the
67string "ogin:". If the first "ogin:" is received then the break sequence is
68not generated.
69.LP
83Once it received the login prompt the \fIchat\fR program will send the string ppp
84and then expect the prompt "ssword:". When it receives the prompt for the
85password, it will send the password hello2u2.
70Once it received the login prompt the \fIchat\fR program will send the
71string ppp and then expect the prompt "ssword:". When it receives the
72prompt for the password, it will send the password hello2u2.
86.LP
87A carriage return is normally sent following the reply string. It is not
88expected in the "expect" string unless it is specifically requested by using
89the \\r character sequence.
90.LP
91The expect sequence should contain only what is needed to identify the
92string. Since it is normally stored on a disk file, it should not contain
93variable information. It is generally not acceptable to look for time

--- 42 unchanged lines hidden (view full) ---

136the string ATDT5551212 to dial the telephone. The expected string is
137\fICONNECT\fR. If the string \fICONNECT\fR is received the remainder of the
138script is executed. However, should the modem find a busy telephone, it will
139send the string \fIBUSY\fR. This will cause the string to match the abort
140character sequence. The script will then fail because it found a match to
141the abort string. If it received the string \fINO CARRIER\fR, it will abort
142for the same reason. Either string may be received. Either string will
143terminate the \fIchat\fR script.
73.LP
74A carriage return is normally sent following the reply string. It is not
75expected in the "expect" string unless it is specifically requested by using
76the \\r character sequence.
77.LP
78The expect sequence should contain only what is needed to identify the
79string. Since it is normally stored on a disk file, it should not contain
80variable information. It is generally not acceptable to look for time

--- 42 unchanged lines hidden (view full) ---

123the string ATDT5551212 to dial the telephone. The expected string is
124\fICONNECT\fR. If the string \fICONNECT\fR is received the remainder of the
125script is executed. However, should the modem find a busy telephone, it will
126send the string \fIBUSY\fR. This will cause the string to match the abort
127character sequence. The script will then fail because it found a match to
128the abort string. If it received the string \fINO CARRIER\fR, it will abort
129for the same reason. Either string may be received. Either string will
130terminate the \fIchat\fR script.
131
132.SH REPORT STRINGS
133A \fBreport\fR string is similar to the ABORT string. The difference
134is that the strings, and all characters to the next control character
135such as a carriage return, are written to the report file.
136.LP
137The report strings may be used to isolate the transmission rate of the
138modem's connect string and return the value to the chat user. The
139analysis of the report string logic occurs in conjunction with the
140other string processing such as looking for the expect string. The use
141of the same string for a report and abort sequence is probably not
142very useful, however, it is possible.
143.LP
144The report strings to no change the completion code of the program.
145.LP
146These "report" strings may be specified in the script using the \fIREPORT\fR
147sequence. It is written in the script as in the following example:
148.IP
149REPORT CONNECT ABORT BUSY '' ATDT5551212 CONNECT '' ogin: account
150.LP
151This sequence will expect nothing; and then send the string
152ATDT5551212 to dial the telephone. The expected string is
153\fICONNECT\fR. If the string \fICONNECT\fR is received the remainder
154of the script is executed. In addition the program will write to the
155expect-file the string "CONNECT" plus any characters which follow it
156such as the connection rate.
144.SH TIMEOUT
145The initial timeout value is 45 seconds. This may be changed using the \fB-t\fR
146parameter.
147.LP
148To change the timeout value for the next expect string, the following
149example may be used:
150.IP
151ATZ OK ATDT5551212 CONNECT TIMEOUT 10 ogin:--ogin: TIMEOUT 5 assowrd: hello2u2

--- 83 unchanged lines hidden (view full) ---

235Collapse the octal digits (ddd) into a single ASCII character and send that
236character.
237.I (some characters are not valid in expect.)
238.TP
239.B \^^C
240Substitute the sequence with the control character represented by C.
241For example, the character DC1 (17) is shown as \^^Q.
242.I (some characters are not valid in expect.)
157.SH TIMEOUT
158The initial timeout value is 45 seconds. This may be changed using the \fB-t\fR
159parameter.
160.LP
161To change the timeout value for the next expect string, the following
162example may be used:
163.IP
164ATZ OK ATDT5551212 CONNECT TIMEOUT 10 ogin:--ogin: TIMEOUT 5 assowrd: hello2u2

--- 83 unchanged lines hidden (view full) ---

248Collapse the octal digits (ddd) into a single ASCII character and send that
249character.
250.I (some characters are not valid in expect.)
251.TP
252.B \^^C
253Substitute the sequence with the control character represented by C.
254For example, the character DC1 (17) is shown as \^^Q.
255.I (some characters are not valid in expect.)
256.SH TERMINATION CODES
257The \fIchat\fR program will terminate with the following completion
258codes.
259.TP
260.B 0
261The normal termination of the program. This indicates that the script
262was executed without error to the normal conclusion.
263.TP
264.B 1
265One or more of the parameters are invalid or an expect string was too
266large for the internal buffers. This indicates that the program as not
267properly executed.
268.TP
269.B 2
270An error occurred during the execution of the program. This may be due
271to a read or write operation failing for some reason or chat receiving
272a signal such as SIGINT.
273.TP
274.B 3
275A timeout event occurred when there was an \fIexpect\fR string without
276having a "-subsend" string. This may mean that you did not program the
277script correctly for the condition or that some unexpected event has
278occurred and the expected string could not be found.
279.TP
280.B 4
281The first string marked as an \fIABORT\fR condition occurred.
282.TP
283.B 5
284The second string marked as an \fIABORT\fR condition occurred.
285.TP
286.B 6
287The third string marked as an \fIABORT\fR condition occurred.
288.TP
289.B 7
290The fourth string marked as an \fIABORT\fR condition occurred.
291.TP
292.B ...
293The other termination codes are also strings marked as an \fIABORT\fR
294condition.
295.LP
296Using the termination code, it is possible to determine which event
297terminated the script. It is possible to decide if the string "BUSY"
298was received from the modem as opposed to "NO DIAL TONE". While the
299first event may be retried, the second will probably have little
300chance of succeeding during a retry.
243.SH SEE ALSO
244Additional information about \fIchat\fR scripts may be found with UUCP
301.SH SEE ALSO
302Additional information about \fIchat\fR scripts may be found with UUCP
245documentation. The \fIchat\fR script was taken from the ideas proposed by the
246scripts used by the \fIuucico\fR program.
303documentation. The \fIchat\fR script was taken from the ideas proposed
304by the scripts used by the \fIuucico\fR program.
247.LP
305.LP
248uucico(8), uucp(1)
306uucico(1), uucp(1)
249.SH COPYRIGHT
250The \fIchat\fR program is in public domain. This is not the GNU public
251license. If it breaks then you get to keep both pieces.
307.SH COPYRIGHT
308The \fIchat\fR program is in public domain. This is not the GNU public
309license. If it breaks then you get to keep both pieces.