cu - call another system (LEGACY)
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
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.
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.
- Emulate local echo, supporting calls to other computer systems that expect terminals to be set to half-duplex mode.
- Dial a remote modem that has been set to auto-answer. Appropriate mapping of carriage-return to carriage-return-line-feed pairs is set.
- Write diagnostic traces.
- Designate that odd parity is to be generated for data sent to the remote system.
- Designate that even parity is to be generated for data sent to the remote system.
- Prompt the user to provide the telephone number to be dialled rather than taking it from the command line. This is for added security.
The following operands are supported:
- 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.
- 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.
The standard input is used to accept data to write to the remote system; see the EXTENDED DESCRIPTION section.
The following environment variables affect the execution of cu:
- 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.
- If set to a non-empty string value, override the values of all the other internationalisation variables.
- 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).
- Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
- Determine the location of message catalogues for the processing of LC_MESSAGES .
The cu utility takes the default action upon receipt of signals, with the exception of:
- Close the connection and terminate.
- Forward to the remote system.
- Forward to the remote system.
- Terminate the cu process without the normal connection closing sequence.
The standard output is used to display data to read from the remote system; see the EXTENDED DESCRIPTION section.
Used only for diagnostic messages.
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.
- Execute the shell command on the local system.
- Run the shell command locally and send its output to the remote system for execution.
- 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.
- Send the line line to the remote system.
- ~%break or ~%b
- Transmit a BREAK to the remote system.
- 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.
The following exit values are returned:
- Successful completion.
- An error occurred.
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.
- To dial a system whose telephone number is 912015551212 using a device-specific speed (where dial tone is expected after the 9):
- To login to a system connected by a direct line:
cu -l /dev/ttyXX
cu -l ttyXX
- To dial a system with the specific line and a specific speed:
cu -s 1200 -l ttyXX
- To dial a system using a specific line associated with an autodialler:
cu -l culXX 9=12015551212
- To use a system name:
cat, echo, stty, uname, uucp.