cu(1) CLIX cu(1)
NAME
cu - Contacts another UNIX system
SYNOPSIS
cu [-s speed] [-lline] [-h] [-t] [-d] [-o|-e] [-n] telno
cu [-s speed] [-h] [-d] [-o -e] -l line
cu [-h] [-d] [-o -e] systemname
FLAGS
-sspeed Specifies the transmission speed (300, 1200, 2400, 4800,
9600); The default value is Any speed which will depend on
the order of the lines in the /usr/lib/uucp/Devices file.
Most modems are either 300 or 1200 baud. Directly connected
lines may be set to a speed higher than 1200 baud.
-lline Specifies a device name to use as the communication line.
This can be used to override the search that would otherwise
take place for the first available line having the right
speed. When the -l flag is used without the -s flag, the
speed of a line is taken from the Devices file. When the -l
and -s flags are both used together, cu will search the
Devices file to check if the requested speed for the
requested line is available. If so, the connection will be
made at the requested speed; otherwise an error message will
be displayed and the call will not be made. The specified
device is generally a directly connected asynchronous line
(for example, /dev/ttyab) in which case a telephone number
(telno) is not required. The specified device need not be in
the /dev directory. If the specified device is associated
with an auto dialer, a telephone number must be provided.
Use of this flag with systemname rather than telno will not
give the desired result (see systemname below).
-h Emulates local echo, supporting calls to other computer
systems which expect terminals to be set to half-duplex mode.
-t Used to dial an ASCII terminal which has been set to auto
answer. Appropriate mapping of carriage-return to carriage-
return-linefeed pairs is set.
-d Causes diagnostic traces to be displayed.
-o Designates that odd parity is to be generated for data sent
to the remote system.
-n For added security, will prompt the user to provide the
2/94 - Intergraph Corporation 1
cu(1) CLIX cu(1)
telephone number to be dialed rather than taking it from the
command line.
-e Designates that even parity is to be generated for data sent
to the remote system.
telno When using an automatic dialer, the argument is the telephone
number with equal signs for secondary dial tone or minus
signs placed appropriately for delays of 4 seconds.
systemname A uucp system name may be used rather than a telephone
number; in this case, cu will obtain an appropriate direct
line or telephone number from /usr/lib/uucp/Systems. Note:
the systemname argument should not be used in conjunction
with the -l and -s flags as cu will connect to the first
available line for the system name specified, ignoring the
requested line and speed.
DESCRIPTION
The cu command contacts another UNIX system, a terminal, or possibly a
non-UNIX system. It manages an interactive conversation with possible
transfers of ASCII files.
After making the connection, cu runs as two processes: the transmit
process reads data from stdin and, except for lines beginning with ~,
passes it to the remote system; the receive process accepts data from the
remote system and, except for lines beginning with ~, passes it to stdout.
Normally, an automatic DC3/DC1 protocol is used to control input from the
remote so the buffer is not overrun. Lines beginning with ~ have special
meanings.
The transmit process interprets the following user-initiated commands:
~. Terminate the conversation.
~! Escape to an interactive shell on the local system.
~!cmd ...
Run cmd on the local system (with sh-c).
~$cmd ...
Run cmd locally and send its output to the remote system.
~%cd Change the directory on the local system. Note: ~!cd will cause
the command to be run by a sub-shell, probably not what was
intended.
~%take from [to]
Copy file from (on the remote system) to file to on the local
system. If to is omitted, the from argument is used in both
2 Intergraph Corporation - 2/94
cu(1) CLIX cu(1)
places.
~%put from [to]
Copy file from (on local system) to file to on remote system. If
to is omitted, the from argument is used in both places.
For both ~%take and put commands, as each block of the file is
transferred, consecutive single digits are displayed to the
terminal.
~~line Send the line ~ line to the remote system.
~%break
Transmit a BREAK to the remote system (which can also be specified
as ~%b).
~%debug
Toggles the d debugging flag on or off (which can also be specified
as ~%d).
~t Displays the values of the termio structure variables for the
user's terminal (useful for debugging).
~l Displays the values of the termio structure variables for the
remote communication line (useful for debugging).
~%nostop
Toggles between DC3/DC1 input control protocol and no input
control. This is useful in case the remote system is one which
does not respond properly to the DC3 and DC1 characters.
The receive process normally copies data from the remote system to its
stdout. Internally the command accomplishes this by initiating an output
diversion to a file when a line from the remote begins with ~.
Data from the remote is diverted (or appended, if >> is used) to file on
the local system. The trailing ~> marks the end of the diversion.
The use of ~%put requires stty and cat on the remote side. It also
requires that the current erase and kill characters on the remote system
be identical to these current control characters on the local system.
Backslashes are inserted at appropriate places.
The use of ~%take requires the existence of echo and cat on the remote
system. Also, tabs mode (See stty) should be set on the remote system if
tabs are to be copied without expansion to spaces.
When cu is used on system X to connect to system Y and subsequently used
on system Y to connect to system Z, commands on system Y can be executed
by using ~~. Executing a tilde command reminds the user of the local
system uname. For example, uname can be executed on Z, X, and Y as
2/94 - Intergraph Corporation 3
cu(1) CLIX cu(1)
follows:
Uname
Z
~[X]!uname
X
~~[Y]!uname
Y
In general, ~ causes the command to be executed on the original machine,
~~ causes the command to be executed on the next machine in the chain.
EXAMPLES
1. Key in the following command line to dial a system whose telephone
number is 9 201 555 1212 using 1200 baud (dialtone is expected after
the 9):
cu -s1200 9=12015551212
If the speed is not specified, any is the default value.
2. Key in one of the following command lines to log in to a system
connected by a direct line:
cu -l /dev/ttyXX
cu -l ttyXX
3. Key in the following command line to dial a system with the specific
line and a specific speed:
cu -s1200 -l ttyXX
4. Key in the following command line to dial a system using a specific
line associated with an auto-dialer:
cu -l culXX 9=12015551212
5. The following command line uses a system name:
cu systemname
FILES
/usr/lib/uucp/Systems
/usr/lib/uucp/Devices
4 Intergraph Corporation - 2/94
cu(1) CLIX cu(1)
/usr/spool/locks/LCK..(tty-device)
NOTES
There is an artificial slowing of transmission by cut ~%put operation so
that loss of data is unlikely.
CAUTIONS
The cu command does not do any integrity checking on data it transfers.
Data fields with special cu characters may not be transmitted properly.
Depending on the interconnection hardware, it may be necessary to use a ~.
to terminate the conversion even if stty has been used. Non-displaying
characters are not dependably transmitted using either the ~%put or ~%take
commands. The command cu between an IMBR1 and a Penril modem will not
return a login prompt immediately upon connection; however, a carriage
return will return the system prompt.
When the DCD pin is to be used in modem connections, the cu command should
open the port with O_NDELAY. To make this happen, the entry for the modem
connection in the /usr/lib/uucp/Devices file should include a ,M
immediately after the line designation, as in the following example:
# Direct tty00,M - 2400 hayes2400
Without the ,M in the entry, setting the modem to &C1 (where DCD shows
that a carrier is present only when one is) and using the cu command hangs
the opening of the port.
EXIT VALUES
The exit value is 0 for a normal exit; otherwise, the exit value is 1.
RELATED INFORMATION
Commands: cat(1), ct(1), echo(1), stty(1), uucp(1), uname(1)
2/94 - Intergraph Corporation 5