Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cu(1C) — UnixWare 2.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cat(1)

cs(1M)

ct(1C)

echo(1)

stty(1)

uname(1)

uucp(1C)






       cu(1C)                                                        cu(1C)


       NAME
             cu - call another UNIX system

       SYNOPSIS
             cu [options] [destination]

       DESCRIPTION
             The cu command calls up another UNIX system, a terminal, or
             possibly a non-UNIX system.  It manages an interactive
             conversation with possible transfers of files.

          Files
             /etc/uucp/Sysfiles
             /etc/uucp/Systems
             /etc/uucp/Devices
             /var/spool/locks/*

          Diagnostics
             Exit code is zero for normal exit, otherwise, one.

       USAGE
             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 cu command sets the input and output conversion mode to on
             or off, as appropriate, to avoid a character conversion on the
             local system when accessing the remote system.

             On the remote system, the input and output conversion should
             be set manually, as cu cannot know whether input conversion is
             required or not.  In most cases, remote systems can be used
             with input conversion on; however, when transferring files,
             this should be set to off before invoking the file transfer
             command in order to avoid unexpected conversion of the file
             contents.

          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
             telephone lines, direct connections, and local area networks
             (LANs).  The Devices file contains a list of media that are


                           Copyright 1994 Novell, Inc.               Page 1













      cu(1C)                                                        cu(1C)


            available on your system.  The Systems file contains
            information for connecting to remote systems, but it is not
            generally readable.

            The destination parameter from the command line is used to
            tell cu what system you wish to connect to.  The 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 [see uucp(1C)] 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 connection attempt to this 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 connection 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.





                          Copyright 1994 Novell, Inc.               Page 2













       cu(1C)                                                        cu(1C)


          Options
             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.

             -d          Causes diagnostic traces to be printed.  Note that
                         this option applies to the conversation phase
                         only.  Since cu uses the Connection Server, cs, to
                         establish the connection, diagnostic information
                         for the connection phase can be obtained from the
                         cs debug file, /var/adm/log/cs.debug.  For
                         additional information, see cs(1M).

             -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
                         2400 or 9600 bps.  Directly connected lines may be
                         set to a speed higher than 2400 bps.

             -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 usually the
                         name of a local area network.

             -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 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 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.  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


                           Copyright 1994 Novell, Inc.               Page 3













      cu(1C)                                                        cu(1C)


                        this option, it must be a telephone number.

            -bn         Forces n to be the number of bits processed on the
                        line.  n is either 7 or 8.  This allows connection
                        between systems with different character sizes.
                        By default, the character size of the line is set
                        to the value specified by the CHARSIZE parameter
                        in the file /etc/uucp/Config.  If no CHARSIZE
                        value is specified in /etc/uucp/Config, the
                        character size of the line is set to the same as
                        the current local terminal.  For example, if no
                        CHARSIZE parameter value is specified in
                        /etc/uucp/Config and you are using an 8-bit
                        system, cu assumes the system you want it to call
                        is another 8-bit system, unless you tell it
                        otherwise, by specifying -b7 on the cu command
                        line.  If the CHARSIZE parameter in
                        /etc/uucp/Config is set to 7 (the default value)
                        and you want cu to call an 8-bit system, you would
                        specify -b8 on the cu command line to override
                        both the CHARSIZE parameter value and the local
                        terminal setting.

            -e          Set an EVEN data parity.  By default, cu uses the
                        value specified by the PARITY parameter in the
                        file /etc/uucp/Config to establish the parity for
                        data sent to the remote system.  By default, the
                        PARITY parameter is set to EVEN.  If no PARITY
                        value is specified in /etc/uucp/Config, cu uses
                        the local terminal setting.  This option forces cu
                        to generate an EVEN parity during data
                        transmission.

            -h          Set communication mode to half-duplex.  This
                        option echoes characters locally 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.  By default, cu uses the
                        value specified by the PARITY parameter in the
                        file /etc/uucp/Config to establish the parity for


                          Copyright 1994 Novell, Inc.               Page 4













       cu(1C)                                                        cu(1C)


                         data sent to the remote system.  By default, the
                         PARITY parameter is set to EVEN.  If no PARITY
                         value is specified in /etc/uucp/Config, cu uses
                         the local terminal setting.  This option forces cu
                         to generate an ODD parity during data
                         transmission.

             -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 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.  Note that,
                                 until the connection is established,
                                 attempting to use ~. to terminate the
                                 conversation will have no effect.

             ~!                  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 the
                                 remote system.

             ~+cmd . . .         run cmd locally and connect its input and
                                 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.




                           Copyright 1994 Novell, Inc.               Page 5













      cu(1C)                                                        cu(1C)


            ~%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 system.

            ~%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 structure
                                variables for the user's terminal (useful
                                for debugging).

            ~l                  prints the values of the termio structure
                                variables for the remote communication
                                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 flow may be
                                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
                                received diversions.





                          Copyright 1994 Novell, Inc.               Page 6













       cu(1C)                                                        cu(1C)


             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 control characters on
             the remote system be identical to the current control
             characters on the local system.  Backslashes are inserted at
             appropriate places for these control characters.

             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
             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.

          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 log on a system that is on a Datakit VCS local area
             network, but which has not been defined by your administrator
             [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.


                           Copyright 1994 Novell, Inc.               Page 7













      cu(1C)                                                        cu(1C)


            To log on 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

         Warnings
            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
            connection.  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.

            Be aware that if invoking cu from the command line in an xterm
            window without the -b option, problems may occur, and ~%take
            may fail.

            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.

      REFERENCES
            cat(1), cs(1M), ct(1C), echo(1), stty(1), uname(1), uucp(1C)






                          Copyright 1994 Novell, Inc.               Page 8








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