System Administration Guide: Network Services

Chat-Script Field in /etc/uucp/Systems File

This field, also known as the Login field, contains a string of characters that is called a chat-script. The chat script contains the characters the local and remote machines must pass to each other in their initial conversation. Chat scripts have the following format:

expect send [expect send] ....

expect represents the string that the local host expects to receive from the remote host to initiate conversation. send is the string that the local host sends after the local host receives the expect string from the remote host. A chat script can have more than one expect-send sequence.

A basic chat script might contain the following:

The expect field can be composed of subfields of the following form:

expect[-send-expect]...

The -send is sent if the prior expect is not successfully read. The -expect that follows the -send is the next expected string.

For example, with strings login--login, the UUCP on the local host expects login. If UUCP receives login from the remote machine, UUCP goes to the next field. If UUCP does not receive login, UUCP sends a carriage return, then looks for login again. If the local computer initially does not expect any characters, use the characters "", for NULL string, in the expect field. All send fields are sent with a carriage return appended unless the send string is terminated with a \c.

The following is an example of a Systems file entry that uses an expect-send string:


sonora Any ACUEC 9600 2223333 "" \r \r ogin:-BREAK-ogin: Puucpx ssword:xyzzy

This example instructs UUCP on the local host to send two carriage returns and wait for ogin: (for Login:). If ogin: is not received, send a BREAK. When you do receive ogin:, send the login name Puucpx. When you receive ssword: (for Password:), send the password xyzzy.

The following table lists some useful escape characters.

Table 26–1 Escape Characters Used in the Chat-Script Field of the Systems File

Escape Character 

Meaning 

\b

Sends or expects a backspace character. 

\c

If at the end of a string, suppresses the carriage return that is normally sent. Ignored otherwise. 

\d

Delays 1–3 seconds before sending more characters. 

\E

Starts echo checking. From this point forward, whenever a character is transmitted, UUCP waits for the character to be received before continuing its checks. 

\e

Echoes check-off.  

\H

Ignores one hangup. Use this option for dialback modems. 

\K

Sends a BREAK character. 

\M

Turns on CLOCAL flag.

\m

Turns off CLOCAL flag.

\n

Sends or expects a newline character. 

\N

Sends a NULL character (ASCII NUL). 

\p

Pauses for approximately 1/4 to 1/2 second. 

\r

Sends or expects a carriage return. 

\s

Sends or expects a space character. 

\t

Sends or expects a tab character. 

EOT

Sends an EOT, followed by newline twice. 

BREAK

Sends a BREAK character. 

\ddd

Sends or expects the character that is represented by the octal digits (ddd).