1
0
Files
irix-657m-src/eoe/man/man1/cu.1c
2022-09-29 17:59:04 +03:00

417 lines
10 KiB
Plaintext

'\"macro stdmacro
.TH CU 1C
.UC 4
.SH NAME
cu \- call another \s-1UNIX\s+1 system
.SH SYNOPSIS
\f3cu\fP [\f2options\f1] [\f3\-s\fP speed] \f3\-l\fP line
.br
\f3cu\fP [\f2options\f1] [\f3\-s\fP speed] [\f3\-l\fP line] [\f3\-n\fP] telno
.br
\f3cu\fP [\f2options\f1] systemname
.sp
where \f2options\f1 can be any of:
.br
[\f3\-h\fP] [\f3\-d\fP] [\f3\-o\fP | \f3\-e\fP] [\f3\-c class\fP]
.SH DESCRIPTION
.I cu
calls up another \s-1UNIX\s+1 system,
a terminal,
or possibly a non-\s-1UNIX\s+1 system.
It manages an interactive conversation with possible
transfers of
.SM ASCII
files.
.PP
.I cu
accepts the following options and arguments:
.TP 12
\&\f3\-s\f1\f2speed\f1
Specifies the transmission speed (300, 1200, 2400, 4800, 9600);
The default value is "Any" speed which will depend on the order of the
lines in the \f3/etc/uucp/Devices\f1 file.
.TP
\&\f3\-l\f1\f2line\f1
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 \f3\-l\f1 option is used without the \f3\-s\f1 option, the speed of a line is taken from the
Devices file. When the \f3\-l\f1 and \f3\-s\f1 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 printed and the call
will not be made. If the device is not found in the Devices file, an
error message similar to
.sp
\f4NO DEVICES AVAILABLE\fP
.sp
is printed.
The specified device is generally a directly connected asynchronous line
(e.g., \f3/dev/ttyd4\f1) in which case a telephone number
(\f2telno\f1) is not required.
The specified device need not be in the \f3/dev\f1 directory.
If the specified device
is associated with an auto dialer, a telephone number must be
provided.
.br
.sp
A line also used by \f2getty\f1(1M) cannot be used with this option.
A line in use by \f2uugetty\f1(1M) can be used, provided the same
physical device name is used by both cu and uugetty.
However, if \f2uugetty\f1(1M) is being used, there is likely to be an
autodialing modem on the line, using an entry in the Dialers file like the
\f3Hayes24\f1 entry, and ready to accept a telephone,
.IR telno ,
number from the \f2cu\f1 command.
.br
.sp
Use of this option with
.I systemname
rather than
.I telno
will not give the desired result (see \f2systemname\f1 below).
.TP
.B \-h
Emulates local echo, supporting calls to other computer systems
which expect terminals to be set to half-duplex mode.
.TP
.B \-t
Used to dial an ASCII terminal which has been set to auto answer.
Appropriate mapping of carriage-return to carriage-return-line-feed
pairs is set.
.TP
.B \-d
Causes diagnostic traces to be printed.
.TP
.B \-o
Designates that odd parity is to be generated for data sent to the remote system.
.TP
.B \-n
For added security, will prompt the user to provide the telephone number to be dialed rather than
taking it from the command line.
.TP
.B \-e
Designates that even parity is to be generated for data sent to the
remote system.
.TP
\&\f3\-c\f1\f2class\f1
Specifies a modem "class" such as \f2ACU\f1 or \f2Direct\f1 found in
the Dialers file.
.TP
.I telno
When using an automatic dialer, the argument
is the telephone number with equal signs for secondary dial tone or minus
signs placed appropriately for delays of 4 seconds.
.TP
.I systemname
A uucp system name may be used rather than a telephone number; in this case,
.I cu
will obtain an appropriate direct line or
telephone number from
.B \%/etc/uucp/Systems.
Note that the
\f2systemname\f1
option should not be used in conjunction with the \f3\-l\f1 and \f3\-s\f1 options as
.I cu\^
will connect to the first available line for the system name specified,
ignoring the requested line and speed.
Note that only the telephone number will be used from the
.B \%/etc/uucp/Systems
file; the chatting to log into the remote system will not be used since it
is unlikely that an interactive user wants to start SLIP, PPP,
or UUCP.
.P
After making the connection,
.I cu\^
runs as two processes:
the
.I transmit\^
process reads data from the standard input and,
except for lines beginning with
.BR ~ ,
passes it to the remote system;
the
.I receive\^
process accepts data from the remote system and,
except for lines beginning with
.BR ~ ,
passes it to the standard output.
Normally, an automatic \s-1DC\s+1\&3/\s-1DC\s+1\&1 protocol
is used to control input from the remote so the buffer is
not overrun.
Lines beginning with \f3~\fP have special meanings.
.PP
The
.I transmit\^
process interprets the following user initiated commands:
.TP 20
.B ~.
terminate the conversation.
.TP
.B ~!
escape to an interactive shell on the local system.
.TP
.BI ~! cmd\|.\|.\|.
run
.I cmd\^
on the local system
(via
.BR "sh \-c" ).
.TP
.BI ~$ cmd\|.\|.\|.
run
.I cmd\^
locally and send its output
to the remote system.
.TP
.B ~\|^Z
suspend the
.I cu\^
session.
(^Z, control-Z, is the current job control suspend character (see
.IR csh (1)
and
.IR stty (1)).
.TP
\&\f3~%cd\fP
change the directory on the local system.
Note:
.B ~!cd
will cause the command to be run by a sub-shell,
probably not what was intended.
.TP
\&\f3~%take\fP \|\f2from\fP \|[ \|\f2to\fP \|]
copy file
.I from\^
(on the remote system)
to file
.I to\^
on the local system.
If
.I to\^
is omitted,
the
.I from\^
argument is used in both places.
The shell commands below are sent to the remote machine to cause it
to transmit the file.
In fact, they are sent in a single line with semicolons (;) between
each command.
.Ex
stty -echo
if test -r arg1; then
(echo '~>':arg2;cat arg1;echo '~>')
else
echo cant\\\'t open: arg1
fi
stty echo
.Ee
.TP
\&\f3~%put\fP \|\f2from\fP \|[ \|\f2to\fP \|]
copy file
.I from\^
(on local system)
to file
.I to\^
on remote system.
If
.I to\^
is omitted, the
.I from\^
argument is used in both places.
.sp
For both \f3~%take\f1 and \f3put\f1 commands, as each block of the file is
transferred, consecutive single digits are printed to the terminal.
.sp
The shell command line below is sent to the remote machine to cause it
to accept the data. Obviously, the shell on the remote machine must
be /bin/sh or a shell that correctly interpret these commands.
.Ex
stty -echo;(cat - > arg2)||cat - >/dev/null;stty echo
.Ee
.TP
\&\f3~~ \|\f2line\f1
send the line
.BR ~
.I line
to the remote system.
.TP
\&\f3~%break\fP
transmit a
.B BREAK
to the remote system (which can also be specified as
.BR ~%b ).
.TP
.B ~%debug
toggles the
.BR -d
debugging option on or off (which can also be specified as
.BR ~%d ).
.TP
.B ~t
prints the values of the termio structure variables for the user's
terminal (useful for debugging).
.TP
.B ~l
prints the values of the termio structure variables for the remote
communication line (useful for debugging).
.TP
.B ~%nostop
toggles between \s-1DC\s+1\&3/\s-1DC\s+1\&1
input control protocol and no input control.
This is useful in case the remote system is one which does
not respond properly to the \s-1DC\s+1\&3 and \s-1DC\s+1\&1 characters.
.PP
The
.I receive\^
process normally copies data from the remote system to its standard
output.
The program accomplishes the \f3~%take\fP command by initiating an
output diversion to a file
when a line from the remote begins with
.BR ~ .
.PP
Data from the remote is diverted (or appended, if
.B >>
is used) to
.IR file
on the local system.
The trailing \f3~>\fP marks the end of the diversion.
.PP
The use of
.B ~%put
requires
.IR stty (1)
and
.IR cat (1)
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.
.PP
The use of
.B ~%take
requires the existence of
.IR echo (1)
and
.IR cat (1)
on the remote system.
Also,
.I tabs
mode (See
.I stty(1))
should be set on the remote system if
tabs are to be copied without expansion to spaces.
.PP
When
.I 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 ~~. 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:
.br
.sp
.RS
uname
.br
Z
.br
~[X]!uname
.br
X
.br
~~[Y]!uname
.br
Y
.br
.RE
.sp
In general,
.B ~
causes the command to be executed on the original machine,
.B ~~
causes the command to be executed on the next machine in
the chain.
.SH EXAMPLES
To dial a system whose telephone number is 9 201 555 1212 using 1200 baud
(where dialtone is expected after the 9):
.RS
cu \-s1200 9=12015551212
.RE
.PP
If the speed is not specified, "Any" is the default value.
.PP
To login to a system connected by a direct line:
.RS
cu \-l /dev/ttyXX
.RE
.PP
or
.RS
cu \-l ttyXX
.RE
.PP
To dial a system with the specific line and a specific speed:
.RS
cu \-s1200 \-l ttyXX
.RE
.PP
To dial a system using a specific line associated with an auto dialer:
.RS
cu \-l culXX 9=12015551212
.RE
.PP
To use a system name:
.RS
cu systemname
.br
.SH FILES
.br
/etc/uucp/Systems
.br
/etc/uucp/Devices
.br
/var/spool/locks/\s-1LCK\s+1..(tty-device)
.br
/dev/tty*
.SH SEE ALSO
cat(1), duart(7), echo(1), stty(1), uucp(1C), uugetty(1M), uname(1).
.SH DIAGNOSTICS
Exit code is zero for normal exit,
otherwise, one.
.SH WARNINGS
The \f2cu\f1 command
does not do any integrity checking on data it transfers.
Data fields with special
.I cu\^
characters may not be transmitted properly.
Depending on the interconnection hardware,
it may be necessary to use a
.B ~.
to terminate the conversion even if
.B stty 0
has been used.
Non-printing characters are not dependably transmitted using either
the \f3~%put\f1 or \f3~%take\f1 commands.
\f2cu\f1 between an IMBR1 and a penril modem
will not return a login prompt immediately upon connection.
A carriage return will return the prompt.
.PP
The device names, dialers, and so forth in \f2/etc/uucp/Devices\f1
must be correct.
Because \f2cu\f1 is suid-uucp,
the device used, such as \f2/dev/ttym3\f1, must be readable and writable
by the "user" uucp.
.SH BUGS
There is an artificial slowing of transmission by
.I cu\^
during the
.B ~%put
operation so that loss of data is unlikely.
.\" @(#)cu.1c 2.0 of 8/17/84
.Ee