libc: import {set,get}mode & b64_{ntop,pton} from FreeBSD
[unleashed.git] / share / man / man1c / cu.1c
blobc339586e9659b39c0424f62291a07e7ba6b1a10b
1 '\" te
2 .\" Copyright 1989 AT&T
3 .\" Copyright (c) 2001, Sun Microsystems, Inc.  All Rights Reserved
4 .\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
6 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
8 .\"  This notice shall appear on any product containing this material.
9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
12 .TH CU 1C "May 11, 2001"
13 .SH NAME
14 cu \- call another UNIX system
15 .SH SYNOPSIS
16 .LP
17 .nf
18 \fBcu\fR [\fB-c\fR \fIdevice\fR | \fB-l\fR \fIline\fR] [\fB-s\fR \fIspeed\fR] [\fB-b\fR \fIbits\fR] [\fB-h\fR] [\fB-n\fR]
19      [\fB-t\fR] [\fB-d\fR] [\fB-o\fR | \fB-e\fR] [\fB-L\fR] [\fB-C\fR] [\fB-H\fR] \fI telno\fR | \fIsystemname\fR
20      [\fIlocal-cmd\fR]
21 .fi
23 .SH DESCRIPTION
24 .sp
25 .LP
26 The command \fBcu\fR calls up another UNIX system, a terminal, or possibly a
27 non-UNIX system. It manages an interactive conversation with possible transfers
28 of files. It is convenient to think of \fBcu\fR as operating in two phases. The
29 first phase is the connection phase in which the connection is established.
30 \fBcu\fR then enters the conversation phase. The \fB-d\fR option is the only
31 one that applies to both phases.
32 .SH OPTIONS
33 .sp
34 .LP
35 \fBcu\fR accepts many options. The \fB-c\fR, \fB-l\fR, and \fB-s\fR options
36 play a part in selecting the medium. The remaining options are used in
37 configuring the line.
38 .sp
39 .ne 2
40 .na
41 \fB\fB-b\fR \fIbits\fR\fR
42 .ad
43 .RS 13n
44 Forces \fIbits\fR to be the number of bits processed on the line. \fIbits\fR is
45 either  \fB7\fR or \fB8\fR. This allows connection between systems with
46 different character sizes.  By default, the character size of the line is set
47 to the same value as the current local terminal, but the character size setting
48 is affected by \fBLC_CTYPE\fR also.
49 .RE
51 .sp
52 .ne 2
53 .na
54 \fB\fB-c\fR \fIdevice\fR\fR
55 .ad
56 .RS 13n
57 Forces \fBcu\fR to use only entries in the "Type" field (the first field in the
58 \fB/etc/uucp/Devices\fR file) that match the user specified \fIdevice\fR,
59 usually the name of a local area network.
60 .RE
62 .sp
63 .ne 2
64 .na
65 \fB\fB-C\fR\fR
66 .ad
67 .RS 13n
68 Runs the \fIlocal-cmd\fR specified at the end of the command line instead of
69 entering interactive mode. The \fBstdin\fR and \fBstdout\fR of the command that
70 is run refer to the remote connection.
71 .RE
73 .sp
74 .ne 2
75 .na
76 \fB\fB-d\fR\fR
77 .ad
78 .RS 13n
79 Prints diagnostic traces.
80 .RE
82 .sp
83 .ne 2
84 .na
85 \fB\fB-e\fR\fR
86 .ad
87 .RS 13n
88 Sets an EVEN data parity.  This option designates that EVEN parity is to be
89 generated for data sent to the remote system.
90 .RE
92 .sp
93 .ne 2
94 .na
95 \fB\fB-h\fR\fR
96 .ad
97 .RS 13n
98 Sets communication mode to half-duplex.  This option emulates local echo in
99 order to support calls to other computer systems that expect terminals to be
100 set to half-duplex mode.
104 .ne 2
106 \fB\fB-H\fR\fR
108 .RS 13n
109 Ignores one hangup. This allows the user to remain in \fBcu\fR while the remote
110 machine disconnects and places a call back to the local machine.  This option
111 should be used when connecting to systems with callback or dialback modems.
112 Once the callback occurs subsequent hangups will cause \fBcu\fR to terminate.
113 This option can be specified more than once. For more information about
114 dialback configuration, see \fBremote\fR(4) and \fISystem Administration Guide:
115 IP Services\fR
119 .ne 2
121 \fB\fB-l\fR \fIline\fR\fR
123 .RS 13n
124 Specifies a device name to use as the communication line. This can be used to
125 override the search that would otherwise take place for the first available
126 line having the right speed. When the \fB-l\fR option is used without the
127 \fB-s\fR option, the speed of a line is taken from the  \fB/etc/uucp/Devices\fR
128 file record in which \fIline\fR matches the second field (the Line field). When
129 the \fB-l\fR and \fB-s\fR options are both used together, \fBcu\fR will search
130 the \fB/etc/uucp/Devices\fR file to check if the requested speed for the
131 requested line is available. If so, the connection will be made at the
132 requested speed, otherwise, an error message will be printed and the call will
133 not be made.  In the general case where a specified device is a directly
134 connected asynchronous line (for instance, \fB/dev/term/a\fR), a telephone
135 number  (\fItelno\fR) is not required. The specified device need not be in the
136 \fB/dev\fR directory. If the specified device is associated with an auto
137 dialer, a telephone number must be  provided.
141 .ne 2
143 \fB\fB-L\fR\fR
145 .RS 13n
146 Goes through the login chat sequence specified in the \fB/etc/uucp/Systems\fR
147 file. For more information about the chat sequence, see \fISystem
148 Administration Guide: IP Services\fR
152 .ne 2
154 \fB\fB-n\fR\fR
156 .RS 13n
157 Requests user prompt for telephone number.  For added security, this option
158 will prompt the user to provide the telephone number to be dialed, rather than
159 taking it from the command line.
163 .ne 2
165 \fB\fB-o\fR\fR
167 .RS 13n
168 Sets an ODD data parity.  This option designates that ODD parity is to be
169 generated for data sent to the remote system.
173 .ne 2
175 \fB\fB-s\fR \fIspeed\fR\fR
177 .RS 13n
178 Specifies the transmission speed (\fB300\fR, \fB1200\fR, \fB2400\fR,
179 \fB4800\fR, \fB9600\fR, \fB19200\fR, \fB38400\fR). The default value is "Any"
180 speed which will depend on the order of the lines in the
181 \fB/etc/uucp/Devices\fR file.
185 .ne 2
187 \fB\fB-t\fR\fR
189 .RS 13n
190 Dials a terminal which has been set to auto answer. Appropriate mapping of
191 carriage-return to carriage-return-line-feed pairs is set.
194 .SH OPERANDS
197 The following operands are supported:
199 .ne 2
201 \fB\fItelno\fR\fR
203 .RS 14n
204 When using an automatic dialler, specifies the telephone number with equal
205 signs for secondary dial tone or minus signs placed appropriately for delays of
206 4 seconds.
210 .ne 2
212 \fB\fIsystemname\fR\fR
214 .RS 14n
215 Specifies a \fBuucp\fR system name, which can be used rather than a telephone
216 number; in this case, \fBcu\fR will obtain an appropriate direct line or
217 telephone number from a system file.
220 .SH USAGE
221 .SS "Connection Phase"
224 \fBcu\fR uses the same mechanism that \fBuucp\fR(1C) does to establish a
225 connection. This means that it will use the \fBuucp\fR control files
226 \fB/etc/uucp/Devices\fR and \fB/etc/uucp/Systems\fR. This gives \fBcu\fR the
227 ability to choose from several different media to establish the connection. The
228 possible media include telephone lines, direct connections, and local area
229 networks (\fBLAN\fR). The \fB/etc/uucp/Devices\fR file contains a list of media
230 that are available on your system. The \fB/etc/uucp/Systems\fR file contains
231 information for connecting to remote systems, but it is not generally readable.
234 \fBNote:\fR \fBcu\fR determines which \fB/etc/uucp/Systems\fR and
235 \fB/etc/uucp/Devices\fR files to use based upon the name used to invoke
236 \fBcu\fR. In the simple case, this name will be "\fBcu\fR", but you could also
237 have created a link to \fBcu\fR with another name, such as "\fBpppcu\fR", in
238 which case \fBcu\fR would then look for a "service=pppcu" entry in the
239 \fB/etc/uucp/Sysfiles\fR file to determine which \fB/etc/uucp/Systems\fR file
240 to use.
243 The \fItelno\fR or \fIsystemname\fR parameter from the command line is used to
244 tell \fBcu\fR what system you wish to connect to. This parameter can be blank,
245 a telephone number, a system name, or a \fBLAN\fR specific address.
247 .ne 2
249 \fBtelephone number\fR
251 .RS 20n
252 A telephone number is a string consisting of the tone dial characters (the
253 digits  \fB0\fR through \fB9\fR, \fB*\fR, and \fB#\fR) plus the special
254 characters \fB=\fR and \fB\(mi\fR\&. The equal sign designates a secondary dial
255 tone and the minus sign creates a  \fB4\fR second delay.
259 .ne 2
261 \fBsystem name\fR
263 .RS 20n
264 A system name is the name of any computer that \fBuucp\fR can call; the
265 \fBuuname\fR(1C) command prints a list of these names.
269 .ne 2
271 \fBLAN address\fR
273 .RS 20n
274 The documentation for your  \fBLAN\fR will show the form of the \fBLAN\fR
275 specific address.
280 If \fBcu\fR's default behavior is invoked (not using the \fB-c\fR or \fB-l\fR
281 options), \fBcu\fR will use the \fItelno\fR or \fIsystemname\fR parameter to
282 determine which medium to use. If a telephone number is specified, \fBcu\fR
283 will assume that you wish to use a telephone line and it will select an
284 automatic call unit (\fBACU\fR). Otherwise, \fBcu\fR will assume that it is a
285 system name. \fBcu\fR will follow the \fBuucp\fR calling mechanism and use the
286 \fB/etc/uucp/Systems\fR and \fB/etc/uucp/Devices\fR files to obtain the best
287 available connection. Since \fBcu\fR will choose a speed that is appropriate
288 for the medium that it selects, you may not use the \fB-s\fR option when this
289 parameter is a system name.
292 The \fB-c\fR and \fB-l\fR options modify this default behavior. \fB-c\fR is
293 most often used to select a  \fBLAN\fR by specifying a Type field from the
294 \fB/etc/uucp/Devices\fR file. You must include either a \fItelno\fR or
295 \fIsystemname\fR value when using the \fB-c\fR option. If the connection to
296 \fIsystemname\fR fails, a connection will be attempted using \fIsystemname\fR
297 as a  \fBLAN\fR specific address. The \fB-l\fR option is used to specify a
298 device associated with a direct connection. If the connection is truly a direct
299 connection to the remote machine, then there is no need to specify a
300 \fIsystemname\fR. This is the only case where a \fItelno\fR or \fIsystemname\fR
301 parameter is unnecessary. On the other hand, there may be cases in which the
302 specified device connects to a dialer, so it is valid to specify a telephone
303 number. The \fB-c\fR and \fB-l\fR options should not be specified on the same
304 command line.
305 .SS "Conversation Phase"
308 After making the connection, \fBcu\fR runs as two processes. The \fBtransmit\fR
309 process reads data from the standard input and, except for lines beginning with
310 \fB~\fR, passes it to the remote system. The \fBreceive\fR process accepts data
311 from the remote system and, except for lines beginning with \fB~\fR, passes it
312 to the standard output. Normally, an automatic DC3/DC1 protocol is used to
313 control input from the remote so the buffer is not overrun. Lines beginning
314 with \fB~\fR have special meanings.
315 .SS "Commands"
318 The \fBtransmit\fR process interprets the following user initiated commands:
320 .ne 2
322 \fB\fB~.\fR\fR
324 .RS 27n
325 Terminates the conversation.
329 .ne 2
331 \fB\fB~!\fR\fR
333 .RS 27n
334 Escapes to an interactive shell on the local system.
338 .ne 2
340 \fB\fB~!\fR\fIcmd\|.\|.\|.\fR\fR
342 .RS 27n
343 Runs \fIcmd\fR on the local system (via \fBsh \fR\fB-c\fR).
347 .ne 2
349 \fB\fB~$\fR\fIcmd\|.\|.\|.\fR\fR
351 .RS 27n
352 Runs \fIcmd\fR locally and send its output to the remote system.
356 .ne 2
358 \fB\fB~%cd\fR\fR
360 .RS 27n
361 Changes the directory on the local system. Note: \fB~!cd\fR will cause the
362 command to be run by a sub-shell, probably not what was intended.
366 .ne 2
368 \fB\fB~%take\fR \fIfrom\fR \|[\fI\|to\fR\|]\fR
370 .RS 27n
371 Copies file \fIfrom\fR (on the remote system) to file \fIto\fR on the local
372 system. If \fIto\fR is omitted, the \fIfrom\fR argument is used in both places.
376 .ne 2
378 \fB\fB~%put\fR \fI\|from\fR \|[\fI\|to\fR\|]\fR
380 .RS 27n
381 Copies file \fIfrom\fR (on local system) to file \fIto\fR on remote system. If
382 \fIto\fR is omitted, the \fIfrom\fR argument is used in both places.
386 .ne 2
388 \fB\fB~~\fR\fI\|line\fR\fR
390 .RS 27n
391 Sends the line \fB~\fR \fIline\fR to the remote system.
395 .ne 2
397 \fB\fB~%break\fR\fR
399 .RS 27n
400 Transmits a  \fBBREAK\fR to the remote system (which can also be specified as
401 \fB~%b\fR).
405 .ne 2
407 \fB\fB~%debug\fR\fR
409 .RS 27n
410 Toggles the \fB-d\fR debugging option on or off (which can also be specified as
411 \fB~%d\fR).
415 .ne 2
417 \fB\fB~t\fR\fR
419 .RS 27n
420 Prints the values of the termio structure variables for the user's terminal
421 (useful for debugging).
425 .ne 2
427 \fB\fB~l\fR\fR
429 .RS 27n
430 Prints the values of the termio structure variables for the remote
431 communication line (useful for debugging).
435 .ne 2
437 \fB\fB~%ifc\fR\fR
439 .RS 27n
440 Toggles between DC3/DC1 input control protocol and no input control. This is
441 useful when the remote system does not respond properly to the DC3 and DC1
442 characters (can also be specified as \fB\(ap%nostop\fR).
446 .ne 2
448 \fB\fB~%ofc\fR\fR
450 .RS 27n
451 Toggles the output flow control setting.  When enabled, outgoing data may be
452 flow controlled by the remote host (can also be specified as
453 \fB\(ap%noostop\fR).
457 .ne 2
459 \fB\fB~%divert\fR\fR
461 .RS 27n
462 Allows/disallows unsolicited diversions.  That is, diversions not specified by
463 \fB~%take\fR.
467 .ne 2
469 \fB\fB~%old\fR\fR
471 .RS 27n
472 Allows/disallows old style syntax for received diversions.
476 .ne 2
478 \fB\fB~%nostop\fR\fR
480 .RS 27n
481 Same as  \fB~%ifc\fR.
486 The \fBreceive\fR process normally copies data from the remote system to the
487 standard output of the local system.  It may also direct the output to local
488 files.
491 The use of \fB~%put\fR requires \fBstty\fR(1) and \fBcat\fR(1) on the remote
492 side. It also requires that the current erase and kill characters on the remote
493 system be identical to these current control characters on the local system.
494 Backslashes are inserted at appropriate places.
497 The use of \fB~%take\fR requires the existence of \fBecho\fR(1) and
498 \fBcat\fR(1) on the remote system, and that the remote system must be using the
499 Bourne shell, \fBsh\fR. Also, \fBtabs\fR mode (see \fBstty\fR(1)) should be set
500 on the remote system if tabs are to be copied without expansion to spaces.
503 When \fBcu\fR is used on system X to connect to system Y and subsequently used
504 on system Y to connect to system Z, commands on system Y can be executed by
505 using \fB~\|~\fR. Executing a tilde command reminds the user of the local
506 system \fBuname\fR. For example, \fBuname\fR can be executed on Z, X, and Y as
507 follows:
509 .in +2
511 uname
513 ~[X]!uname
515 ~~[Y]!uname
518 .in -2
522 In general, \fB~\fR causes the command to be executed on the original machine.
523 \fB~\|~\fR causes the command to be executed on the next machine in the chain.
524 .SH EXAMPLES
526 \fBExample 1 \fRDialling a system
529 To dial a system whose telephone number is  \fB9\fR \fB1\fR \fB201\fR \fB555\fR
530 \fB1234\fR using  \fB1200\fR baud (where dialtone is expected after the
531 \fB9\fR):
534 .in +2
536 example% \fBcu \fR\fB-s\fR\fB 1200 9=12015551234\fR
538 .in -2
543 If the speed is not specified, "Any" is the default value.
546 \fBExample 2 \fRLogging in to a system on a direct line
549 To login to a system connected by a direct line:
552 .in +2
554 example% \fBcu \fR\fB-l\fR\fB /dev/term/b\fR
556 .in -2
564 .in +2
566 example% \fBcu \fR\fB-l\fR\fB term/b\fR
568 .in -2
572 \fBExample 3 \fRDialling a system with specific line and speed
575 To dial a system with a specific line and speed:
578 .in +2
580 example% \fBcu \fR\fB-s\fR\fB 1200 \fR\fB-l\fR\fB term/b\fR
582 .in -2
586 \fBExample 4 \fRUsing a system name
589 To use a system name:
592 .in +2
594 example% \fBcu systemname\fR
596 .in -2
599 .SH ENVIRONMENT VARIABLES
602 See \fBenviron\fR(5) for descriptions of the following environment variables
603 that affect the execution of \fBcu\fR: \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and
604 \fBNLSPATH\fR.
605 .SH EXIT STATUS
608 The following exit values are returned:
610 .ne 2
612 \fB\fB0\fR\fR
614 .RS 6n
615 Successful completion.
619 .ne 2
621 \fB\fB>0\fR\fR
623 .RS 6n
624 An error occurred.
627 .SH FILES
629 .ne 2
631 \fB\fB/etc/uucp/Devices\fR\fR
633 .RS 22n
634 device file
638 .ne 2
640 \fB\fB/etc/uucp/Sysfiles\fR\fR
642 .RS 22n
643 system file
647 .ne 2
649 \fB\fB/etc/uucp/Systems\fR\fR
651 .RS 22n
652 system file
656 .ne 2
658 \fB\fB/var/spool/locks/*\fR\fR
660 .RS 22n
661 lock file
664 .SH SEE ALSO
667 \fBcat\fR(1), \fBecho\fR(1), \fBstty\fR(1), \fBtip\fR(1), \fBuname\fR(1),
668 \fBct\fR(1C), \fBuuname\fR(1C), \fBuucp\fR(1C), \fBremote\fR(4),
669 \fBattributes\fR(5), \fBenviron\fR(5)
672 \fISystem Administration Guide: IP Services\fR
673 .SH NOTES
676 The \fBcu\fR utility takes the default action upon receipt of signals, with the
677 exception of:
679 .ne 2
681 \fB\fBSIGHUP\fR\fR
683 .RS 11n
684 Close the connection and terminate.
688 .ne 2
690 \fB\fBSIGINT\fR\fR
692 .RS 11n
693 Forward to the remote system.
697 .ne 2
699 \fB\fBSIGQUIT\fR\fR
701 .RS 11n
702 Forward to the remote system.
706 .ne 2
708 \fB\fBSIGUSR1\fR\fR
710 .RS 11n
711 Terminate the \fBcu\fR process without the normal connection closing sequence.
716 The \fBcu\fR command does not do any integrity checking on data it transfers.
717 Data fields with special \fBcu\fR characters may not be transmitted properly.
718 Depending on the interconnection hardware, it may be necessary to use a
719 \fB~.\fR to terminate the conversion, even if \fBstty 0\fR has been used.
720 Non-printing characters are not dependably transmitted using either the
721 \fB~%put\fR or \fB~%take\fR commands. \fB~%put\fR and \fB~%take\fR cannot be
722 used  over multiple links.  Files must be moved one link at a time.
725 There is an artificial slowing of transmission by \fBcu\fR during the
726 \fB~%put\fR operation so that loss of data is unlikely.  Files transferred
727 using \fB~%take\fR or \fB~%put\fR must contain a trailing newline, otherwise,
728 the operation will hang.  Entering a Control-D command usually clears the hang
729 condition.