The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

cu - call another system (LEGACY)

 SYNOPSIS



cu -n[-dht] [-o | -e ][-l line][-s speed]

cu [-dht] [-o | -e ][-l line][-s speed] telno

cu [-dht] [-o | -e ][-s speed] -l line

cu [-dht] [-o | -e ] systemname

 DESCRIPTION

The cu utility calls up another system. It manages an interactive conversation, with possible transfers of text files.

On systems where there are no available communications means (either temporarily or permanently), this utility will write an error message describing the problem and exit with a non-zero exit status.

 OPTIONS

The cu utility supports the XBD specification, Utility Syntax Guidelines  . The following options are supported:
-s speed
Specify the transmission speed. The default value is device-specific.
-l line
Specify 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. 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 written and the call will not be made. If the specified device is associated with an autodialler, a telephone number must be provided.
-h
Emulate local echo, supporting calls to other computer systems that expect terminals to be set to half-duplex mode.
-t
Dial a remote modem that has been set to auto-answer. Appropriate mapping of carriage-return to carriage-return-line-feed pairs is set.
-d
Write diagnostic traces.
-o
Designate that odd parity is to be generated for data sent to the remote system.
-e
Designate that even parity is to be generated for data sent to the remote system.
-n
Prompt the user to provide the telephone number to be dialled rather than taking it from the command line. This is for added security.

 OPERANDS

The following operands are supported:
telno
When using an automatic dialler, specifies the telephone number with equal signs for secondary dial tone or minus signs placed appropriately for delays of 4 seconds.
systemname
Specifies a uucp system name, which can be used rather than a telephone number; in this case, cu will obtain an appropriate direct line or telephone number from a system file.

 STDIN

The standard input is used to accept data to write to the remote system; see the EXTENDED DESCRIPTION section.

 INPUT FILES

None.

 ENVIRONMENT VARIABLES

The following environment variables affect the execution of cu:
LANG
Provide a default value for the internationalisation variables that are unset or null. If LANG is unset or null, the corresponding value from the implementation-dependent default locale will be used. If any of the internationalisation variables contains an invalid setting, the utility will behave as if none of the variables had been defined.
LC_ALL
If set to a non-empty string value, override the values of all the other internationalisation variables.
LC_CTYPE
Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments and input data).
LC_MESSAGES
Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
NLSPATH
Determine the location of message catalogues for the processing of LC_MESSAGES .

 ASYNCHRONOUS EVENTS

The cu utility takes the default action upon receipt of signals, with the exception of:
SIGHUP
Close the connection and terminate.
SIGINT
Forward to the remote system.
SIGQUIT
Forward to the remote system.
SIGUSR1
Terminate the cu process without the normal connection closing sequence.

 STDOUT

The standard output is used to display data to read from the remote system; see the EXTENDED DESCRIPTION section.

 STDERR

Used only for diagnostic messages.

 OUTPUT FILES

None.

 EXTENDED DESCRIPTION

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 system so that the buffer is not overrun. Lines beginning with "~" have special meanings.

The transmit process interprets the following user-initiated commands as:

~.
Terminate the conversation.
~!
Escape to an interactive command interpreter on the local system.
~!command
Execute the shell command on the local system.
~$command
Run the shell command locally and send its output to the remote system for execution.
~%cd
Change the directory on the local system.
~%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 or ~%b
Transmit a BREAK to the remote system.
~%nostop
Toggle 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.

The receive process normally copies data from the remote system to its standard output.

The use of ~%put requires stty and cat 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 and cat on the remote system. Also, tabs mode (see stty) 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 "~~". For example, uname can be executed on Z, X and Y as follows:


$ uname
Z
$~[X]!uname
X
$~~[Y]!uname
Y

(The darker type indicates system-generated text. The bracketed system names are written by the system after it has recognised the ! pair, but before it echoed the "!".) 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.

 EXIT STATUS

The following exit values are returned:
0
Successful completion.
>1
An error occurred.

 CONSEQUENCES OF ERRORS

Default.

 APPLICATION USAGE

Typical implementations of this utility require a communications line configured to use the XBD specification, General Terminal Interface  , but other communications means may be used.

 EXAMPLES

  1. To dial a system whose telephone number is 912015551212 using a device-specific speed (where dial tone is expected after the 9):
    
    cu 9=12015551212
    
    

  2. To login to a system connected by a direct line:
    
    cu -l /dev/ttyXX
    
    

    or:

    
    cu -l ttyXX
    
    

  3. To dial a system with the specific line and a specific speed:
    
    cu -s 1200 -l ttyXX
    
    

  4. To dial a system using a specific line associated with an autodialler:
    
    cu -l culXX 9=12015551212
    
    

  5. To use a system name:
    
    cu systemname
    
    

 FUTURE DIRECTIONS

None.

 SEE ALSO

cat, echo, stty, uname, uucp.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]