cu(1C) USER COMMANDS cu(1C)
NAME
cu - call another UNIX system
SYNOPSIS
cu [ options ] [ destination ]
DESCRIPTION
cu calls up another UNIX system, a terminal, or possibly a
non-UNIX system. It manages an interactive conversation
with possible transfers of files. It is convenient to think
of cu as operating in two phases. The first phase is the
connection phase in which the connection is established. cu
then enters the conversation phase. The -d option is the
only one that applies to both phases.
-d Causes diagnostic traces to be printed.
Connection Phase
cu uses the same mechanism that uucp does to establish a
connection. This means that it will use the uucp control
files /etc/uucp/Devices and /etc/uucp/Systems. This gives
cu the ability to choose from several different media to
establish the connection. The possible media include tele-
phone lines, direct connections, and local area networks
(LAN). The Devices file contains a list of media that are
available on your system. The Systems file contains infor-
mation for connecting to remote systems, but it is not gen-
erally readable. The destination parameter from the command
line is used to tell cu what system you wish to connect to.
destination can be blank, a telephone number, a system name,
or a LAN specific address. A telephone number is a string
consisting of the tone dial characters (the digits 0 through
9, *, and #) plus the special characters = and -. The equal
sign designates a secondary dial tone and the minus sign
creates a 4 second delay. A system name is the name of any
computer that uucp can call; the uuname command prints a
list of these names. The documentation for your LAN will
show the form of the LAN specific address. If cu's default
behavior is invoked (not using the -c or -l options), cu
will use destination to determine which medium to use. If
destination is a telephone number, cu will assume that you
wish to use a telephone line and it will select an automatic
call unit (ACU). If the destination is not a telephone
number, then cu will assume that it is a system name. cu
will follow the uucp calling mechanism and use the Systems
and Devices files to obtain the best available connection.
Since cu will choose a speed that is appropriate for the
medium that it selects, you may not use the -s option when
destination is a system name. The -c and -l options modify
this default behavior. -c is most often used to select a
LAN by specifying a Type field from the Devices file. Here,
destination is assumed to be a system name. If the
Last change: Basic Networking Utilities 1
cu(1C) USER COMMANDS cu(1C)
connection attempt to system name fails, a connection will
be attempted using destination as a LAN specific address.
The -l option is used to specify a device associated with a
direct connection. If the connection is truly a direct con-
nection to the remote machine, then there is no need to
specify a destination. This is the only case where a blank
destination is allowed. On the other hand, there may be
cases in which the specified device connects to a dialer, so
it is valid to specify a telephone number as a destination.
The -c and -l options should not be specified on the same
command line. cu accepts many options. The -c, -l, and -s
options play a part in selecting the medium; the remaining
options are used in configuring the line.
-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 /etc/uucp/Devices file. Most
modems are either 300, 1200, or 2400 baud.
Directly connected lines may be set to a speed
higher than 2400 baud.
-ctype The first field in the Devices file is the
"Type" field. The -c option forces cu to only
use entries in the "Type" field that match the
user specified type. The specified type is usu-
ally the name of a local area network.
-lline Specifies a device name to use as the communica-
tion 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 option is used without the -s
option, the speed of a line is taken from the
Devices file record in which line matches the
second field (the Line field). When the -l and
-s options are both used together, cu will
search the Devices file to check if the
requested speed for the requested line is avail-
able. If so, the connection will be made at the
requested speed, otherwise, an error message
will be printed and the call will not be made.
In the general case where a specified device is
a directly connected asynchronous line (e.g.,
/dev/term/ab), 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. If destination is used
with this option, it must be a telephone number.
-bn Forces n to be the number of bits processed on
Last change: Basic Networking Utilities 2
cu(1C) USER COMMANDS cu(1C)
the line. n is either 7 or 8. This allows con-
nection between systems with different character
sizes. By default, the character size of the
line is set to the same as the current local
terminal.
-e Set an EVEN data parity. This option designates
that EVEN parity is to be generated for data
sent to the remote system.
-h Set communication mode to half-duplex. This
option emulates the local echo(1) command in
order to support calls to other computer systems
that expect terminals to be set to half-duplex
mode.
-n Request user prompt for telephone number. For
added security, this option will prompt the user
to provide the telephone number to be dialed,
rather than taking it from the command line.
-o Set an ODD data parity. This option designates
that ODD parity is to be generated for data sent
to the remote system.
-t Used to dial a terminal which has been set to
auto answer. Appropriate mapping of carriage-
return to carriage-return-line-feed pairs is
set.
Conversation Phase
After making the connection, cu runs as two processes: the
transmit process reads data from the standard input 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
the standard output. Normally, an automatic DC3/DC1 proto-
col is used to control input from the remote so the buffer
is not overrun. Lines beginning with ~ have special mean-
ings.
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 (via sh -c).
~$cmd... run cmd locally and send its output to
Last change: Basic Networking Utilities 3
cu(1C) USER COMMANDS cu(1C)
the remote system.
~%cd change the directory on the local sys-
tem. 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 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.
~~ line send the line ~ line to the remote sys-
tem.
~%break transmit a BREAK to the remote system
(which can also be specified as ~%b).
~%debug toggles the -d debugging option on or
off (which can also be specified as
~%d).
~t prints the values of the termio struc-
ture variables for the user's terminal
(useful for debugging).
~l prints the values of the termio struc-
ture variables for the remote communica-
tion line (useful for debugging).
~%ifc toggles between DC3/DC1 input control
protocol and no input control. This is
useful when the remote system does not
respond properly to the DC3 and DC1
characters. (can also be specified as
_%nostop).
~
~%ofc toggles the output flow control setting.
When enabled, outgoing data may be flow
controlled by the remote host (can also
be specified as _%noostop).
~
~%divert allow/disallow unsolicited diversions.
That is, diversions not specified by
~%take.
~%old allow/disallow old style syntax for
Last change: Basic Networking Utilities 4
cu(1C) USER COMMANDS cu(1C)
received diversions.
The receive process normally copies data from the remote
system to the standard output of the local system. It may
also direct the output to local files.
The use of ~%put requires stty(1) and cat(1) 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(1) and
cat(1) on the remote system. Also, tabs mode (See stty(1))
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 sub-
sequently 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 follows:
uname
Z
~[X]!uname
X
~~[Y]!uname
Y
In general, ~ causes the command to be executed on the ori-
ginal machine. ~~ causes the command to be executed on the
next machine in the chain.
EXAMPLES
To dial a system whose telephone number is 9 1 201 555 1234
using 1200 baud (where dialtone is expected after the 9):
cu -s1200 9=12015551234
If the speed is not specified, "Any" is the default value.
To login to a system that is on a Datakit VCS local area
network, but which has not been defined by your administra-
tor (i.e. is not entered in the /etc/uucp/Systems file(s)):
cu -c DK address
DK is the name of the Datakit local area network, and
address is the Datakit address which is of the form,
/area/exchange/machine.
Last change: Basic Networking Utilities 5
cu(1C) USER COMMANDS cu(1C)
To login to a system connected by a direct line:
cu -l /dev/term/XX
or
cu -l term/XX
To dial a system with a specific line and speed:
cu -s1200 -l term/XX
To dial a system using a specific line associated with an
auto dialer:
cu -l culXX 9=12015551234
To use a system name:
cu systemname
FILES
/etc/uucp/Sysfiles
/etc/uucp/Systems
/etc/uucp/Devices
/var/spool/locks/*
SEE ALSO
cat(1), ct(1C), echo(1), stty(1), uucp(1C), uname(1),
uuname(1).
System Administrator's Guide.
DIAGNOSTICS
Exit code is zero for normal exit, otherwise, one.
NOTES
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 0 has been used. Non-printing
characters are not dependably transmitted using either the
~%put or ~%take commands. cu, between an IMBR1 and a PENRIL
modem, will not return a login prompt immediately upon con-
nection. A carriage return will return the prompt.
~%put and ~%take cannot be used over multiple links. Files
must be moved one link at a time.
There is an artificial slowing of transmission by cu during
the ~%put operation so that loss of data is unlikely. Files
transferred using ~%take or ~%put must contain a trailing
newline, otherwise, the operation will hang. Entering a
CTRL-d command usually clears the hang condition.
Last change: Basic Networking Utilities 6