- online man pages   

SunOS man pages : cu (1)

Communication Commands                                     cu(1C)


cu - call another UNIX system


cu [ -c device | -l line ] [ -s speed ] [ -b bits ] [ -h ] [ -n ] [ -t ] [ -d ] [ -o | -e ] [ -L ] [ -C ] [ -H ] telno | systemname [ local-cmd ]


The command cu calls up another UNIX system, a terminal, or possibly a non-UNIX system. It manages an interactive conversation with possible transfers of files. It is con- venient 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 -d option is the only one that applies to both phases.


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. -c device Forces cu to use only entries in the "Type" field (the first field in the /etc/uucp/Devices file) that match the user specified device, usually the name of a local area network. -s speed Specifies the transmission speed (300, 1200, 2400, 4800, 9600, 19200, 38400). The default value is "Any" speed which will depend on the order of the lines in the /etc/uucp/Devices file. -l line 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 /etc/uucp/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 /etc/uucp/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 asynchro- nous line (for instance, /dev/term/a), a telephone number (telno) is not required. The specified device need not be in the /dev directory. If the specified SunOS 5.8 Last change: 10 Dec 1998 1 Communication Commands cu(1C) device is associated with an auto dialer, a telephone number must be provided. -b bits Forces bits to be the number of bits processed on the line. bits 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 same value as the current local terminal, but the character size setting is affected by LC_CTYPE also. -h Sets communication mode to half-duplex. This option emulates local echo in order to support calls to other computer systems that expect terminals to be set to half-duplex mode. -n Requests 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. -t Dials a terminal which has been set to auto answer. Appropriate mapping of carriage-return to carriage- return-line-feed pairs is set. -d Prints diagnostic traces. -o Sets an ODD data parity. This option designates that ODD parity is to be generated for data sent to the remote system. -e Sets an EVEN data parity. This option designates that EVEN parity is to be generated for data sent to the remote system. -L Goes through the login chat sequence specified in the /etc/uucp/Systems file. For more information about the chat sequence, see System Administration Guide, Volume 3 -C Runs the local-cmd specified at the end of the command line instead of entering interactive mode. The stdin and stdout of the command that is run refer to the remote connection. -H Ignores one hangup. This allows the user to remain in cu while the remote machine disconnects and places a call back to the local machine. This option should be used when connecting to systems with callback or dial- back modems. Once the callback occurs subsequent hang- ups will cause cu to terminate. This option can be specified more than once. For more information about SunOS 5.8 Last change: 10 Dec 1998 2 Communication Commands cu(1C) dialback configuration, see remote(4) and System Administration Guide, Volume 3


The following operands are supported: telno When using an automatic dialler, specifies the tele- phone 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.


Connection Phase cu uses the same mechanism that uucp(1C) 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 estab- lish the connection. The possible media include telephone lines, direct connections, and local area networks (LAN). The /etc/uucp/Devices file contains a list of media that are available on your system. The /etc/uucp/Systems file con- tains information for connecting to remote systems, but it is not generally readable. Note: cu determines which /etc/uucp/Systems and /etc/uucp/Devices files to use based upon the name used to invoke cu. In the simple case, this name will be "cu", but you could also have created a link to cu with another name, such as "pppcu", in which case cu would then look for a "service=pppcu" entry in the /etc/uucp/Sysfiles file to determine which /etc/uucp/Systems file to use. The telno or systemname parameter from the command line is used to tell cu what system you wish to connect to. This parameter can be blank, a telephone number, a system name, or a LAN specific address. telephone number 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. system name A system name is the name of any computer that uucp SunOS 5.8 Last change: 10 Dec 1998 3 Communication Commands cu(1C) can call; the uuname(1C) command prints a list of these names. LAN address 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 the telno or systemname parameter to determine which medium to use. If a telephone number is specified, cu will assume that you wish to use a telephone line and it will select an automatic call unit (ACU). Other- wise, cu will assume that it is a system name. cu will fol- low the uucp calling mechanism and use the /etc/uucp/Systems and /etc/uucp/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 this parameter 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 /etc/uucp/Devices file. You must include either a telno or systemname value when using the -c option. If the connection to systemname fails, a connection will be attempted using systemname 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 con- nection to the remote machine, then there is no need to specify a systemname. This is the only case where a telno or systemname parameter is unnecessary. 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. The -c and -l options should not be specified on the same com- mand line. 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. Commands The transmit process interprets the following user initiated commands: ~. Terminates the conversation. ~! Escapes to an interactive shell on the local system. SunOS 5.8 Last change: 10 Dec 1998 4 Communication Commands cu(1C) ~!cmd... Runs cmd on the local system (via sh -c). ~$cmd... Runs cmd locally and send its output to the remote system. ~%cd Changes the directory on the local system. Note: ~!cd will cause the command to be run by a sub-shell, prob- ably not what was intended. ~%take from [to] Copies 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] Copies file from (on local system) to file to on remote system. If to is omitted, the from argument is used in both places. ~~line Sends the line ~ line to the remote system. ~%break Transmits 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 debug- ging). ~%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 charac- ters (can also be specified as ~%nostop). ~%ofc Toggles the output flow control setting. When enabled, outgoing data may be flow controlled by the remote host (can also be specified as ~%noostop). ~%divert Allows/disallows unsolicited diversions. That is, diversions not specified by ~%take. SunOS 5.8 Last change: 10 Dec 1998 5 Communication Commands cu(1C) ~%old Allows/disallows old style syntax for received diver- sions. ~%nostop Same as ~%ifc. 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 erase and kill char- acters 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(1) and cat(1) on the remote system, and that the remote system must be using the Bourne shell, sh. 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 sub- sequently 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 ori- ginal machine. ~~ causes the command to be executed on the next machine in the chain.


Example 1: Dialling a system To dial a system whose telephone number is 9 1 201 555 1234 using 1200 baud (where dialtone is expected after the 9): example% cu -s 1200 9=12015551234 If the speed is not specified, "Any" is the default value. Example 2: Logging in to a system on a direct line SunOS 5.8 Last change: 10 Dec 1998 6 Communication Commands cu(1C) To login to a system connected by a direct line: example% cu -l /dev/term/b or example% cu -l term/b Example 3: Dialling a system with specific line and speed To dial a system with a specific line and speed: example% cu -s 1200 -l term/b Example 4: Using a system name To use a system name: example% cu systemname


See environ(5) for descriptions of the following environment variables that affect the execution of cu: LC_CTYPE, LC_MESSAGES, and NLSPATH.


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


/etc/uucp/Devices device file /etc/uucp/Sysfiles system file /etc/uucp/Systems system file /var/spool/locks/* lock file


See attributes(5) for descriptions of the following attri- butes: SunOS 5.8 Last change: 10 Dec 1998 7 Communication Commands cu(1C) ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWbnuu | |_____________________________|_____________________________|


cat(1), echo(1), stty(1), uname(1), ct(1C), uuname(1C ), uucp(1C), remote(4), attributes(5), environ(5) System Administration Guide, Volume 3


The cu utility takes the default action upon receipt of sig- nals, 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. 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 char- acters are not dependably transmitted using either the ~%put or ~%take commands. ~%put and ~%take cannot be used over multiple links. Files must be moved one link at a time. 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. SunOS 5.8 Last change: 10 Dec 1998 8