CU(1C) | Communication Commands | CU(1C) |
cu - call another UNIX system
cu [-c device | -l line] [-s speed] [-b bits] [-h] [-n]
[-t] [-d] [-o | -e] [-L] [-C] [-H] telno | systemname
[local-cmd]
The command 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.
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.
-b bits
-c device
-C
-d
-e
-h
-H
-l line
-L
-n
-o
-s speed
-t
The following operands are supported:
telno
systemname
cu uses the same mechanism that uucp(1C) 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 telephone lines, direct connections, and local area networks (LAN). The /etc/uucp/Devices file contains a list of media that are available on your system. The /etc/uucp/Systems file contains information for connecting to remote systems, but it is not generally readable.
Note: cu determines which /etc/uucp/Systems and /etc/uucp/Devices files to use based upon the name used to invoke cu. In the simple case, this name will be "cu", but you could also have created a link to cu with another name, such as "pppcu", in which case cu would then look for a "service=pppcu" entry in the /etc/uucp/Sysfiles file to determine which /etc/uucp/Systems file to use.
The telno or systemname parameter from the command line is used to tell cu what system you wish to connect to. This parameter can be blank, a telephone number, a system name, or a LAN specific address.
telephone number
system name
LAN address
If cu's default behavior is invoked (not using the -c or -l options), cu will use the telno or systemname parameter to determine which medium to use. If a telephone number is specified, cu will assume that you wish to use a telephone line and it will select an automatic call unit (ACU). Otherwise, cu will assume that it is a system name. cu will follow the uucp calling mechanism and use the /etc/uucp/Systems and /etc/uucp/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 this parameter 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 /etc/uucp/Devices file. You must include either a telno or systemname value when using the -c option. If the connection to systemname fails, a connection will be attempted using systemname 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 connection to the remote machine, then there is no need to specify a systemname. This is the only case where a telno or systemname parameter is unnecessary. 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. The -c and -l options should not be specified on the same command line.
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 user initiated commands:
~.
~!
~!cmd...
~$cmd...
~%cd
~%take from [to]
~%put from [to]
~~line
~%break
~%debug
~t
~l
~%ifc
~%ofc
~%divert
~%old
~%nostop
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, and that the remote system must be using the Bourne shell, sh. 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 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 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.
Example 1 Dialling a system
To dial a system whose telephone number is 9 1 201 555 1234 using 1200 baud (where dialtone is expected after the 9):
example% cu -s 1200 9=12015551234
If the speed is not specified, "Any" is the default value.
Example 2 Logging in to a system on a direct line
To login to a system connected by a direct line:
example% cu -l /dev/term/b
or
example% cu -l term/b
Example 3 Dialling a system with specific line and speed
To dial a system with a specific line and speed:
example% cu -s 1200 -l term/b
Example 4 Using a system name
To use a system name:
example% cu systemname
See environ(7) for descriptions of the following environment variables that affect the execution of cu: LC_CTYPE, LC_MESSAGES, and NLSPATH.
The following exit values are returned:
0
>0
/etc/uucp/Devices
/etc/uucp/Sysfiles
/etc/uucp/Systems
/var/spool/locks/*
cat(1), echo(1), stty(1), tip(1), uname(1), ct(1C), uucp(1C), uuname(1C), remote(5), attributes(7), environ(7)
System Administration Guide: IP Services
The cu utility takes the default action upon receipt of signals, with the exception of:
SIGHUP
SIGINT
SIGQUIT
SIGUSR1
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. ~%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 Control-D command usually clears the hang condition.
May 11, 2001 | OmniOS |