cu(1C) cu(1C)
NAME
cu - call another UNIX® system
SYNOPSIS
cu [-d] [-e] [-h] [-lline] [-m] [-n] [-o] [-sspeed] [-t]
args
DESCRIPTION
cu calls up another UNIX® system, a terminal, or possibly a
non-UNIX system. It manages an interactive conversation
with possible transfers of ASCII files.
cu accepts the following flag options and arguments:
-sspeed
Specifies the transmission speed (110, 150, 300, 600,
1200, 4800, 9600); 300 is the default value. 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 searching for the
first available line having the right speed. When the
-l flag option is used without the -s flag option, the
speed of a line is taken from the file
/usr/lib/uucp/L-devices. When the -l and -s flag
options are used simultaneously, cu will search the L-
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 printed and the call will not be
made. The specified device is generally a
directly-connected asynchronous line (e.g.,
/dev/ttyab), in this case, a phone number is not
required, but the string dir may be use to specify a
null acu. If the specified device is associated with
an auto dialer, a phone number must be provided.
-h Emulates local echo, supporting calls to other computer
systems which expect terminals to be set to half-duplex
mode.
-t Used when dialing an ASCII terminal which has been set
to `auto answer'. Appropriate mapping of carriage-
return to carriage-return-line-feed pairs is set.
-d Causes diagnostic traces to be printed.
-e Designates that even parity is to be generated for data
sent to the remote.
Page 1 (last mod. 1/16/87)
cu(1C) cu(1C)
-o Designates that odd parity is to be generated for data
sent to the remote.
-m Designates a direct line which has modem control.
-n Will request the phone number to be dialed from the
user rather than taking it from the command line.
args may be one of:
telno
When using an automatic dialer the argument is the
telephone number with equals signs for secondary dial
tone or minus signs for delays, at appropriate places.
systemname
A uucp system name may be used rather than a phone
number; in this case, cu will obtain an appropriate
direct line or phone number from /usr/lib/uucp/L.sys
(the appropriate baud rate is also read along with
phone numbers). cu will try each phone number or direct
line for systemname in the L.sys file until a
connection is made or all the entries are tried.
dir Using dir ensures that cu will use the line specified
by the -l flag option.
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
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:
. terminate the conversation.
! escape to an interactive shell on the
local system.
!cmd run cmd on the local system (via sh -c).
B$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
Page 2 (last mod. 1/16/87)
cu(1C) cu(1C)
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.
cmd send the line cmd to the remote system.
%break transmit a BREAK to the remote system.
%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 standard output. A line from the remote that
begins with > initiates an output diversion to a file. The
complete sequence is:
> [ > ] :file
zero or more lines to be written to file
>
Data from the remote are diverted (or appended, if >> is
used) to file. The trailing > terminates the diversion.
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 the current
ones 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, stty tabs mode should be
set on the remote system if tabs are to be copied without
expansion.
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 . For
example, uname may be executed on Z, X, and Y as follows:
uname
Z
~!uname
Page 3 (last mod. 1/16/87)
cu(1C) cu(1C)
X
~~!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
In the following, XX is the device ID of the desired line,
and YYYZZZ is the name of the desired system.
To dial a system whose number is 9 201 555 999 using 1200
baud:
cu -s1200 9=201555999
If the speed is not specified, 300 is the default value.
To login to a system connected by a direct line:
cu -l /dev/ttyXX dir
where XX is the device ID of the desired line.
To dial a system with the specific line and a specific
speed:
cu -s1200 -l /dev/ttyXX dir
To dial a system using a specific line:
cu -l /dev/culXX 2015559999
To use a system name:
cu YYYZZZ
FILES
/usr/bin/cu
/usr/lib/uucp/L.sys
/usr/lib/uucp/L-devices
/usr/spool/uucp/LCK..(tty-device)
/dev/null
SEE ALSO
cat(1), ct(1C), echo(1), stty(1), tip(1), uname(1),
uucp(1C),
``Using cu'' in Oreo Communications User's Guide.
DIAGNOSTICS
Exit code is zero for normal exit, non-zero (various values)
otherwise.
BUGS
cu buffers input internally.
There is an artificial slowing of transmission by cu during
the %put operation so that loss of data is unlikely.
Page 4 (last mod. 1/16/87)
cu(1C) cu(1C)
NOTE
Any input character after a will be preceded by [sysname]
(inserted by cu).
Page 5 (last mod. 1/16/87)