CU(1C) HP-UX 5.0 CU(1C) NAME cu - call another (HP-UX) system; terminal emulator SYNOPSIS cu [-sspeed] [-lline] [-h] [-t] [-q] [-o|-e] [-d] [-m] [-n] telno | systemname | dir telno HP-UX COMPATIBILITY Level: HP-UX/STANDARD Origin: System V Native Language Support: 8-bit data. DESCRIPTION Cu calls up another HP-UX system, a terminal, or possibly a non-HP-UX system. It manages an interactive conversation with possible transfers of ASCII files. Cu accepts the following options and arguments: -sspeed Specifies the transmission speed (110, 134, 150, 300, 600, 1200, 2400, 3600, 7200, 4800, 9600, 19200); 300 is the default value. Most modems are either 300 or 1200 baud. Directly connected lines may be set to a speed higher than 1200 baud. When using a direct-connect line, the -s option has no effect. The first line which matches the -l option is used, and its speed is taken from L-devices. -lline Specifies a device name to use as the communication line. This can be used to override searching 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 file /usr/lib/uucp/L-devices. When the -l and -s options are used simultaneously, cu will search the L-devices file to check whether 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. The specified device is generally a directly connected asynchronous line (e.g., /dev/ttyab); in this case a phone number is not required but the string dir may be use to specify a null ACU. If the specified device is associated with an auto-dialer, a phone number must be provided. -h Emulates local echo, supporting calls to other computer systems which expect terminals to be set to half-duplex mode. -q Invokes the use of ENQ/ACK handshake. -t Used when dialing an ASCII terminal which has been set to auto answer. Appropriate mapping of carriage-return to carriage-return-line-feed pairs is set. -d Causes diagnostic traces to be printed. -e(-o) Designates that even (odd) parity is to be generated for data sent to the remote. -m Designates a direct line which has modem control. -n Requests the phone number to be dialed from the user rather than taking it from the command line. telno When using an automatic dialer, this argument is the telephone number, with equal signs inserted to wait for secondary dial tones and minus signs inserted for any other delays. systemname A uucp system name may be used rather than a phone number; in this case, cu will obtain an appropriate direct line or phone number from /usr/lib/uucp/L.sys (the appropriate baud rate is also read along with phone numbers). Cu will try each phone number or direct line for systemname in the L.sys file until either a connection is made or all the entries are tried. dir Using dir insures that cu will use the line specified by the -l option. 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: ~. and ~.. terminate the conversation. On a hardwired line (only), ~. sends several EOF characters to log out the session; ~.. will suppress the EOF sequence. In general the remote hardwired machine will be unaware of the disconnect if ~.. is used. ~. and ~.. do not differ for dialup connections. ~! escape to an interactive shell on the local system. ~!cmd... run cmd on the local system (via sh -c). ~& just like ~! but kill the receive process, restoring it upon return from the shell. This is useful for invoking sub-processes which read from the communication line (i.e., kermit). ~&cmd... run cmd on the local system (via sh -c) and kill the receive process, restoring it later. ~$cmd... run cmd locally and send its 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, which is probably not what was intended. ~%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 ~... to the remote system. If you use cu on the remote system to access a third remote system, send ~~. to cause the second remote cu to exit. ~%break transmit a BREAK to the remote system. ~%nostop toggles between DC3/DC1 input control protocol and no input control. This is useful in case the remote system is one which does not respond properly to the DC3 and DC1 characters. ~%file Divert output from the remote system to the specified file until another ~%> command is given. When an output diversion is active, typing ~%> will terminate it, and ~%>anotherfile will terminate it and begin a new one. The output diversion (surprisingly) remains active through a ~& subshell, but unpredictable results may occur if input/output diversions are intermixed with ~%take or ~%put. The receive process normally copies data from the remote system to its standard output. A line from the remote that begins with ~> initiates an output diversion to a file. The complete sequence is: ~>[>]:file zero or more lines to be written to file ~> Data from the remote is diverted (or appended, if >> is used) to file. The trailing ~> terminates the diversion. 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 the current ones 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. Also, stty tabs mode should be set on the remote system if tabs are to be copied without expansion. 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 if ~~ is used. For example, uname can be executed on Z, X, and Y as follows: uname Z X ~!uname Y In general, ~ causes the command to be executed on the original machine, and ~~ causes the command to be executed on the next machine in the chain. EXAMPLES To dial a system whose number is 9 201 555 1212 using 1200 baud: cu -s1200 9=2015551212 If the speed is not specified, 300 is the default value. To login to a system connected by a direct line: cu -l /dev/ttyXX dir To dial a system with the specific line and a specific speed: cu -s1200 -l /dev/ttyXX dir To dial a system using a specific line: cu -l /dev/culXX 2015551212 To use a system name: cu YYYZZZ FILES /usr/lib/uucp/L.sys /usr/lib/uucp/L-devices /usr/spool/uucp/LCK..(tty-device) /dev/null SEE ALSO cat(1), ct(1C), echo(1), stty(1), uname(1), uucp(1C). DIAGNOSTICS Exit code is zero for normal exit, non-zero (various values) otherwise. BUGS Cu buffers input internally. There is an artificial slowing of transmission by cu during the ~%put operation so that loss of data is unlikely.