cu(1C) cu(1C)NAME cu - establishes an interactive connection with another system SYNOPSIS cu [-bbits] [-dhint] [-e] [-cdevice-type] [-o] [-sbaud-rate] [-xdebug-level] -ldevice-name cu [-bbits] [-dhint] [-e] [-cdevice-type] [-ldevice-name] [-o] [-sbaud-rate] [-xdebug-level] telephone-number cu [-bbits] [-dhint] [-e] [-cdevice-type] [-ldevice-name] [-o] [-sbaud-rate] [-xdebug-level] system ARGUMENTS -bbits Sets the bits per character. The value of bits can be 7 or 8. This option allows communications between systems with different character sizes. The default value of bits is the current character size set for your local terminal. Use stty -a to see the character- size setting. This setting will be cs7 or cs8. If you set the bits per character to 8, do not use the -e or -o option. -cdevice-type Causes cu to use only those entries in the Devices file whose device-type field matches the value specified by device-type. If you use this option, you must also supply a system argument or use the -l option. -d Causes a diagnostic trace to be displayed while the connection is open. This option is equivalent to using -x9. -e Designates that even parity is to be generated for data sent to the remote system. If you use this option, the number of bits per character must be 7. -h Sets half-duplex mode. This option emulates the local echo command in order to support calls to other computer systems that expect terminals to be set to half-duplex mode. -i Causes cu to ignore modem control signals. -ldevice-name Specifies the name of the device to use for establishing the connection. This option overrides the default method used by cu to determine the connection medium, as described in ``Connection Phase'' later in this manual page. This option is especially useful January 1992 1
cu(1C) cu(1C)when a serial cable directly connects the remote system to your system. In this case, you do not need to provide a system argument. If you do not use the -s option with the -l option, cu uses the baud rate of the first entry in the Devices file whose device-name field matches the value of device-name. If the baud rate of the selected entry is Any, the default baud rate, as specified by the Default_Baudrate keyword in the Config file, is used. If you use both the -l and the -s options, cu searches the Devices file to verify that specified baud rate is available. If the verification succeeds, the connection is made at the requested baud rate; otherwise, an error message is printed and the connection is not made. -n Causes cu to prompt for the telephone-number argument. You should use this option when you incorporate the cu command in a shell script if you do not want to incorporate the telephone number in the script for security reasons. -o Designates that odd parity is to be generated for data sent to the remote system. If you use this option, the number of bits per character must be 7. -sbaud-rate Specifies the baud rate; 300, 1200, 2400, 4800, and 9600 are common values. See termio(7) for a list of valid baud rates. The default value depends on the order of entries in the Devices file. -t Causes cu to dial a terminal that has been set to answer automatically. Appropriate mapping of carriage returns to carriage-return-line-feed pairs is set. system Specifies the name of a system. When you supply a system argument, cu checks the Systems file for an entry whose first field matches the value of system and uses the third field of the matching entry to determine the connection medium. To override this method, use the -c option. To see a list of systems to which your computer is configured to connect, use the uuname command. telephone-number Specifies the telephone number to dial. The value of telephone-number can consist of the digits 0 to 9, the asterisk (*), the number sign (#), the equal sign (=), 2 January 1992
cu(1C) cu(1C)and the minus sign (-). Use the equal sign to wait for a secondary dial tone, and the minus sign to pause for approximately 4 seconds. -xdebug-level Writes debugging information on standard output. The value of debug-level is a number from 0 to 9. Higher numbers produce more detailed debugging information. DESCRIPTION cu establishes an interactive connection with another A/UX system, another UNIX(Reg.) system, or a non-UNIX system. Once connected, you can also use cu to transfer files. You can think of cu as operating in two phases. The first phase is the connection phase, in which the connection is established. The second phase is the interactive phase, which cu enters when the connection is established. Connection Phase The cu command uses the Devices and Systems files, which are also used by the uucico command, to establish the connection to another system. The ct command also uses the Devices file. For cu to work, your system administrator must set up these files in view of the connection media that are available for your system. The Devices file specifies the medium by which a connection is made to the remote system. The medium can be a direct serial connection or an asynchronous modem and a telephone line. The Systems file contains information about how to connect to a remote system. By default, cu assumes that if a telephone-number argument appears on the command line, it should examine the Devices file to find the first entry that begins with the keyword ACU and use the device that is associated with that entry if available. If the device is not available, cu searches the remainder of that file, looking for an ACU entry with an available device. You can override this default search mechanism by using the -l option. By default, cu assumes that if a system argument appears on the command line, it should examine the Systems file for an entry whose first field matches the value of system. If cu finds a match, it uses the information in the entry to determine the medium (direct serial connection or autodialing modem) to use to make the connection. You can override this default search mechanism by using the -l option. January 1992 3
cu(1C) cu(1C)Conversation Phase Once the connection is made, cu runs as two processes: a ``transmit'' process that reads data from the standard input and, except for lines beginning with a tilde (~), passes the data to the remote system and a ``receive'' process that accepts data from the remote system and, except for lines beginning with ~, passes the data to the standard output. By default, cu uses CONTROL-S and CONTROL-Q to control input from the remote to prevent buffer overrun. The cu transmit process interprets user-initiated lines that begin with ~ as special commands. Here are the available commands: ~. Terminates the connection. ~! Starts an interactive shell on the local system. ~!cmd... Runs the commands specified by cmd on the local system, using sh -c. Note that ~!cd causes the command to be run by a subshell, which is probably not what was intended. See the description of ~%cd later in this list, for an alternative. ~$cmd... Runs the command specified by cmd on the local system and sends its output to the remote system. ~%cd directory Changes your current working directory on the local system. ~%take from [to] Copies the file on the remote system specified by from to the file specified by to on the local system. If to is omitted, the name of the file on the remote system is used as the name of the copied file on the local system. ~%put from [to] Copies the file on the local system specified by from to the file specified by to on the remote system. If to is omitted, the name of the file on the local system is used as the name of the copied file. ~~line Sends the line ~line to the remote system. ~%bits number Changes the number of bits per character to the value specified by number. The value of number can be 7 or 4 January 1992
cu(1C) cu(1C)8. ~%break Transmits a break character to the remote system. The short name of this command is ~%b. ~%debug Toggles the -d option on and off. The short name of this command is ~%d. ~%even Changes the parity to even parity. ~h Displays a list of the cu special commands. ~%none Disables parity generation and checking. ~%odd Changes the parity to odd parity. ~%speedbaud-rate Changes the baud rate to the value specified by baud-rate, such as, for example, 4800. ~t Prints the values of the termio structure for your terminal. This option is useful when you are having problems connecting to a certain computer or using a certain modem. ~l Prints the values of the termio structure for the communication line that cu is using. This option is useful when you are debugging. ~%ifc Toggles the input flow-control setting. When this command is enabled, which is the default, the local system controls input from the remote system by using the CONTROL-S and CONTROL-Q flow-control protocol. The flow-control protocol is useful only if the remote system also uses the protocol. Another name for this command is ~%nostop. ~%ofc Toggles the output flow-control setting. When this command is enabled, the remote system can control output from the local system by using the CONTROL-S and CONTROL-Q flow-control protocol. This option is useful only if the remote system also uses the protocol. Another name for this command is %noostop. ~%divert January 1992 5
cu(1C) cu(1C)Toggles the setting for allowing or disallowing diversions that are not specified by the ~%take command. ~%old Toggles the setting for allowing or disallowing old- style syntax for received diversions. The ``receive'' process normally copies data from the remote system to the standard output of the local system. It can also direct the output to local files. The ~%put command requires the presence of the stty and cat commands on the remote side, which limits the use of ~%put to connections with other UNIX systems. The ~%put command also requires that the erase and cancel characters on the remote system be identical to these characters on the local system. See stty(1) for details. The ~%put command inserts backslashes at appropriate places. The ~%take command requires the presence of echo and cat on the remote system, which limits the use of ~%take to connections with other UNIX systems. To copy files without expanding tabs to spaces, use the stty command on the remote system to turn on the tabs mode. When you use cu on your local system X to connect to system Y and then use cu on system Y to connect to system Z, you can run commands on system Y by using ~~. To remind yourself of which system the command is being run on, use the uname command. For example, uname can be run on systems X, Y, and Z as follows: uname System Z replies with Z. You then type ~!uname Your local system, X, replies with X. You then type ~~!uname System Y replies with Y. In general, the absence of a tilde causes the command to be run on the system that you most recently logged in to. A single tilde causes the command to be run on your local system. Two or more tildes cause the command to be run on the next system in the chain. EXAMPLES This command dials a system whose telephone number is 9 1 201 555 1234 on a telephone system where a dial tone is 6 January 1992
cu(1C) cu(1C)expected after the 9, using a baud rate of 1200: cu -s1200 9=12015551234 If you do not specify the -s option, cu uses the baud rate specified in the first entry in the Devices file that begins with ACU. This command connects to a system by using a serial cable attached to /dev/tty0 on the local system: cu -l/dev/tty0 You can also specify the argument to the -l option as tty0. This command specifies a baud rate and a device: cu -s1200 -ltty00 This command connects to a system by using a specific device that is connected to an autodialing modem: cu -l/dev/tty0 9=12015551234 On a Macintosh running A/UX, the argument to the -l option can also be /dev/modem or modem. This command connects to a system named walrus, which, depending on the walrus entry in the Systems file, can be reached by a direct connection or an autodialing modem. cu walrus STATUS MESSAGES AND VALUES To indicate a normal termination condition, cu exits with 0; to indicate an error condition, cu exits with 1. LIMITATIONS The cu command does not do any integrity checking on the data it transfers. See uucp(1C) and rcp(1C) for transfer programs that perform integrity checking. Data containing special cu characters, such as a tilde, may not transmit properly. The ~%put and ~%take commands do not dependably transmit nonprinting characters. A cu connection between some modems does not display the login prompt immediately upon connection. Pressing RETURN causes the prompt to be displayed. January 1992 7
cu(1C) cu(1C)The ~%put and ~%take commands cannot be used over a chain of three or more systems. You must move the files one system at a time. During file transmissions using the ~%put command, cu artificially slows transmission to reduce the risk of data loss. Any file transferred with ~%take or ~%put must contain a trailing newline character; otherwise, the transfer is suspended. Pressing CONTROL-D usually clears the condition. FILES /usr/bin/cu Executable file /usr/lib/uucp Directory of uucp commands and configuration files /usr/lib/uucp/Devices File containing configuration information for devices /usr/lib/uucp/file File used exclusively by cu or uucico, as specified by the Sysfiles file, containing configuration information for remote systems /usr/lib/uucp/Sysfiles Optional file specifying that cu or uucico is to use a file other than the default file, Systems, to get configuration information for remote systems /usr/lib/uucp/Systems File containing configuration information for remote systems /usr/spool/locks/* Directory of lock files, which are used to indicate that a serial device is in use. SEE ALSO cat(1), echo(1), stty(1), uname(1), uucp(1C), uuname(1C) Chapter 8, ``Setting Up the UUCP System,'' in A/UX Network System Administration 8 January 1992