Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cu(1c) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cat

ct

echo

stty, STTY

uuname

uucp



CU(1c,C)                    AIX Commands Reference                     CU(1c,C)



-------------------------------------------------------------------------------
cu



PURPOSE

Connects directly or indirectly to another UNIX system.

SYNTAX


      +------------+   +-----------+   +------+   +------+   +------+
cu ---|            |---|           |---|      |---|      |---|      |--->
      +- -s speed -+   +- -l line -+   +- -h -+   +- -t -+   +- -d -+

      +------+
    +-|      |-+   +- telno --+
>---| +- -o -+ |---|          |---|
    | +------+ |   +-- -n ----+
    +-|      |-+
      +- -e -+

                                               +------+
      +------------+   +------+   +------+   +-|      |-+
cu ---|            |---|      |---|      |---| +- -o -+ |-- -l line --|
      +- -s speed -+   +- -h -+   +- -d -+   | +------+ |
                                             +-|      |-+
                                               +- -e -+

                              +------+
      +------+   +------+   +-|      |-+
cu ---|      |---|      |---| +- -o -+ |-- system name --|
      +- -h -+   +- -d -+   | +------+ |
                            +-|      |-+
                              +- -e -+


DESCRIPTION

The Basic Networking Utilities (BNU) command cu connects one system to another
UNIX system, to a terminal connected to a UNIX system, or, if the proper
hardware and software are installed, to a non-UNIX system.  The connection can
be established over a hard-wired line, or over a telephone line via a modem.

Once the connection is established, a user can be logged in on both systems at
the same time, executing commands on either one without dropping the BNU
communication link.  If the remote computer is also running under UNIX, the
user can transfer ASCII files between the two systems.

When using a modem, you can specify the telno argument (telephone number) with
appropriately placed equal signs for secondary dial tones, or minus signs for



Processed November 8, 1990         CU(1c,C)                                   1





CU(1c,C)                    AIX Commands Reference                     CU(1c,C)



delays of 4 seconds.  Or you can specify the system_name argument (a uucp
system name) instead; in this case, the cu command obtains an appropriate
hard-wired line or telephone number from the file /usr/adm/uucp/Systems.

After issuing the cu command from the local system, press the Enter key
(carriage return) and then log in to the remote system.  When the connection is
made, the cu command runs as two concurrent processes:  the transmit process
reads data from standard input and, except for lines beginning with a ~
(tilde), passes that data to the remote terminal.  The receive process accepts
data from the remote system and, except for lines beginning with a ~, passes it
to standard output.  To control input from the remote system so the buffer is
not overrun, the cu command uses an automatic DC3/DC1 (Ctrl-Q/Ctrl-S) protocol.

In addition to issuing regular AIX commands on the remote system, the user can
also issue special cu local commands, which are preceded by a ~.  Use these
commands to issue AIX commands on the local system and to perform tasks such as
transferring files between two UNIX systems.

Notes:

  1. The system must be configured to use the cu command before you issue this
    command.  Refer to Managing the AIX Operating System for details about this
    configuration.

  2. Do not use the system_name flag in conjunction with the -1 and -s flags.
    If you do, the cu command connects to the first available line for the
    requested system name, ignoring the specified line and speed.

Local Commands

The transmit process interprets lines beginning with a tilde in the following
ways:

~.                     Logs the user off the remote computer and terminates the
                       remote connection.

~!                     Returns the user to an interactive shell on the local
                       system.  Toggle between the local and remote systems by
                       using ~! (remote to local) and pressing Ctrl-D (local to
                       remote).

~!cmd...               Executes the command denoted by cmd on the local system
                       via sh -c.

~$cmd...               Runs the command denoted by cmd locally and sends its
                       output to the remote system for execution.

~%cd                   Changes the directory on the local system.

~%take from [ to ]     Copies the from file on the remote system to the to file
                       on the local system.  If to is omitted, the remote file
                       is copied to the local system under the same file name.



Processed November 8, 1990         CU(1c,C)                                   2





CU(1c,C)                    AIX Commands Reference                     CU(1c,C)



                       As each block of the file is transferred, consecutive
                       single digits are displayed on the terminal screen.

~%put from [ to ]      Copies the from file on the local system to the to file
                       on the remote system.  If to is omitted, the local file
                       is copied to the remote system under the same file name.
                       As each block of the file is transferred, consecutive
                       single digits are displayed on the terminal screen.

~~line                 Sends the string denoted by ~line to the remote system.

~%break                Transmits a BREAK to the remote system.  The BREAK can
                       also be specified as ~%b.

~%debug                Toggles the -debug flag on or off; this can also be
                       specified as ~%d.

~t                     Prints the values of the TERMIO structure variables for
                       the user's terminal.  This is useful for debugging.

~l                     Prints the values of the TERMIO structure variables for
                       the remote communication line. This is 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 that does not respond properly to the DC3 and DC1
                       characters.

Note:  As soon as the user enters ~!,~%, ~$, ~t, or ~l, the system displays the
       name of the local computer in the a format such as the following:

       ~[system_name]!/%

       The user then enters the command to be executed on the local computer.

Additional Information

  o The receive process normally copies data from the remote system to the
    local system's standard output.  Internally, the program accomplishes this
    by initiating an output diversion to a file when a line from the remote
    system begins with ~>.

    Data from the remote system is diverted to file on the local system.  The
    trailing ~> marks the end of the diversion.

  o The use of ~%put requires stty and cat on the remote system.  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.





Processed November 8, 1990         CU(1c,C)                                   3





CU(1c,C)                    AIX Commands Reference                     CU(1c,C)



  o The use of ~%take requires echo and cat on the remote system.  Also, stty
    tabs mode should be set on the remote system if tabs are to be copied
    without expansion to spaces.

  o The cu command can be used to connect multiple systems, and commands can
    then be executed on any of the connected systems.  For example, issue the
    cu command on system X to connect to system Y, and then issue the cu
    command on system Y to connect to system Z.  System X is then the local
    computer, and systems Y and Z are remote computers.

    The user can execute commands on system Z by logging on and issuing the
    command.  Commands can be executed on system X by prefixing the command
    with a single tilde (~cmd), and on system Y by prefixing the command with
    two tildes (~~cmd).  In general, one tilde causes the specified command to
    be executed on the original local computer, and two tildes cause the
    command to be executed on the next system on which the cu command was
    issued.

    For example, once the multiple systems are connected, the user can execute
    the uname command with the -n flag (to display the node name) on Z, X, and
    Y as follows:

      $ uname -n
      Z
      $ ~!uname -n
      X
      $ ~~!uname -n
      Y

Notes:

  1. After executing the cu command, the user must log in to the remote system
    and press Enter (carriage return).

  2. The cu command does not do integrity checking on data it transfers.

  3. Data fields with special cu command characters may not be transmitted
    properly.

  4. Depending on the interconnection hardware, it may be necessary to use a ~.
    to terminate the conversation even if the normal logout sequence has been
    used.

  5. There is an artificial slowing of transmission by the cu command during
    the ~%put operation so that loss of data is unlikely.

  6. The exit code is 0 for normal exit, otherwise, the code is -1.

FLAGS






Processed November 8, 1990         CU(1c,C)                                   4





CU(1c,C)                    AIX Commands Reference                     CU(1c,C)



-sspeed  Specifies the transmission speed (300, 1200, 2400, 4800, 9600).  The
         default value is Any speed, which instructs the system to use the rate
         appropriate for the default (or specified) transmission line.  (The
         order of the transmission lines is specified in the
         /usr/adm/uucp/Devices file.)  Most modems operate at 300, 1200, or
         2400 baud, while most hard-wired lines are set to 1200 baud or higher.

-lline   Specifies a device name to use as the communication line.  This flag
         can be used to override the search that would otherwise take place for
         the first available line with the right speed.  When the -l flag is
         used without the -s flag, the speed of a line is taken from the
         /usr/adm/uucp/Devices file.  When the -l and -s flags are used
         together, the cu command searches the /usr/adm/uucp/Devices file to
         check whether the requested speed is available for the specified line.
         If so, the connection is made at the requested speed; otherwise, an
         error message is printed, and the call is not made.

         The specified device is generally a hard-wired asynchronous line (for
         example, /dev/tty2), in which case a telephone number (telno) is not
         required.  If the specified device is associated with a modem, a
         telephone number must be provided.  Using this flag with system_name
         rather than with telno does not give the desired result (see
         system_name).

         Note:  Under ordinary circumstances, the user should not have to
                specify the transmission speed or a line/device.  The defaults
                set when BNU is installed should be sufficient.  Refer to
                Managing the AIX Operating System for information about setting
                defaults.

-h       Emulates local echo, supporting calls to other systems that expect
         terminals to be set to half-duplex mode.

-t       Used to dial an ASCII terminal that has been set to auto answer.
         Appropriate mapping of carriage-return to carriage-return line-feed
         pairs is set.

-d       Prints diagnostic traces.

-o       Designates that odd parity is to be generated for data sent to the
         remote system.

-e       Designates that even parity is to be generated for data sent to the
         remote system.

-n       For added security, prompts the user to provide the telephone number
         to be dialed, rather than taking it from the command line.

EXAMPLES

  1. To connect to a remote system using a system name:




Processed November 8, 1990         CU(1c,C)                                   5





CU(1c,C)                    AIX Commands Reference                     CU(1c,C)



      cu hera

  2.  To dial a remote system whose telephone number is 1-201-555-1212, where
    dialing 9 is required to get an outside dial tone and the baud rate is
    1200:

      cu -s 1200 9=12015551212

    If the speed is not specified, Any is the default value.

  3. To log in to a system connected by a hard-wired line:

      cu -l /dev/tty2

    or

      cu -l tty2

  4. To dial a remote system with the specified line and a specific speed:

      cu -s 1200  -l tty3

  5. To dial a remote system using a specific line associated with a modem:

      cu -l cul4  9=12015551212

  6. To copy a file from the local system to the remote system (after logging
    in to the remote system):

      ~%put /u/amy/file

    or

      ~%put /u/amy/file /u/amy/tmpfile

FILES

/etc/locks/LCK..(tty-device)  Prevents multiple use of device.
/usr/adm/uucp/Devices         Information about available links.
/usr/adm/uucp/Dialcodes       Dialing code abbreviations.
/usr/adm/uucp/Dialers         Initial handshaking on a link.
/usr/adm/uucp/Permissions     Access permission codes.
/usr/adm/uucp/Systems         Accessible remote systems.

RELATED INFORMATION

See the following commands:  "cat,"  "ct,"  "echo," "stty, STTY,"  "uuname,"
and  "uucp."







Processed November 8, 1990         CU(1c,C)                                   6



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026