Really merge from OpenBSD import (should have been done a year ago).

Reviewed by:	markm
Approved by:	re
This commit is contained in:
ru 2002-11-27 09:18:28 +00:00
parent 132707858e
commit 76efc30bb5

View File

@ -35,101 +35,192 @@
.\" @(#)tip.1 8.4 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
.Dd April 18, 1994
.Dd September 9, 2001
.Dt TIP 1
.Os
.Sh NAME
.Nm tip
.Nm tip ,
.Nm cu
.Nd connect to a remote system
.Sh SYNOPSIS
.Nm
.Op Fl v
.Fl Ns Ns Ar speed
.Ar system\-name
.Nm
.Op Fl v
.Fl Ns Ns Ar speed
.Ar phone\-number
.Op Fl nv
.Op Fl Ar speed
.Op Ar system-name
.Nm cu
.Op Fl ehot
.Op Fl a Ar acu
.Op Fl l Ar line
.Op Fl s Ar speed
.Op Fl Ar #
.Op Ar phone-number
.Sh DESCRIPTION
The
.Nm
command establishes a full-duplex connection to another machine,
giving the appearance of being logged in directly on the
remote cpu. It goes without saying that you must have a login
on the machine (or equivalent) to which you wish to connect.
and
.Nm cu
utilities
establish a full-duplex connection to another machine, giving the
appearance of being logged in directly on the remote CPU.
It goes without saying that you must have a login on the machine (or
equivalent) to which you wish to connect.
The preferred interface is
.Nm .
The
.Nm cu
interface is included for those people attached to the
.Dq call Ux
command of
.At v7 .
This manual page
describes only
.Nm .
.Pp
Available Option:
.Bl -tag -width indent
The options are as follows:
.Bl -tag -width ".Fl s Ar speed"
.It Fl a Ar acu
Set the acu.
.It Fl l Ar line
For
.Nm cu ,
specify the line to use.
Either of the forms like
.Pa tty00
or
.Pa /dev/tty00
are permitted.
.It Fl n
No escape (disable tilde).
.It Fl s Ar speed
For
.Nm cu ,
set the speed of the connection.
Defaults to 9600.
.It Fl v
Set verbose mode.
.El
.Pp
If
.Ar speed
is specified it will override any baudrate specified in the system
description being used.
.Pp
If neither
.Ar speed
nor
.Ar system-name
are specified,
.Ar system-name
will be set to the value of the
.Ev HOST
environment variable.
.Pp
If
.Ar speed
is specified but
.Ar system-name
is not,
.Ar system-name
will be set to a value of
.Dq Li tip
with
.Ar speed
appended.
E.g.,
.Nm Fl 1200
will set
.Ar system-name
to
.Dq Li tip1200 .
.Pp
Typed characters are normally transmitted directly to the remote
machine (which does the echoing as well). A tilde (`~') appearing
as the first character of a line is an escape signal; the following
are recognized:
.Bl -tag -width flag
.It Ic \&~^D No or Ic \&~ .
Drop the connection and exit
(you may still be logged in on the
remote machine).
.It Ic \&~c Op Ar name
machine (which does the echoing as well).
A tilde
.Pq Ql ~
appearing as the first character of a line is an escape signal; the
following are recognized:
.Bl -tag -width indent
.It Xo
.Ic ~^D
or
.Ic ~.
.Xc
Drop the connection and exit (you may still be logged in on the remote
machine).
.It Ic ~c Op Ar name
Change directory to
.Ar name
(no argument
implies change to your home directory).
.It Ic \&~!
Escape to a shell (exiting the shell will
return you to tip).
.It Ic \&~>
(no argument implies change to your home directory).
.It Ic ~!
Escape to a shell (exiting the shell will return you to
.Nm ) .
.It Ic ~>
Copy file from local to remote.
The
.Nm
utility prompts for the name of a local file to transmit.
.It Ic \&~<
utility
prompts for the name of a local file to transmit.
.It Ic ~<
Copy file from remote to local.
The
.Nm
utility prompts first for the name of the file to be sent, then for
a command to be executed on the remote machine.
.It Ic \&~p Ar from Op Ar to
utility
prompts first for the name of the file to be sent, then for a command
to be executed on the remote machine.
.It Ic ~p Ar from Op Ar to
Send a file to a remote
.Ux
host. The put command causes the remote
host.
The put command causes the remote
.Ux
system to run the command string ``cat > 'to''', while
system to run the command string
.Dq Nm cat Li \&> Ar to ,
while
.Nm
sends it the ``from''
file. If the ``to'' file isn't specified the ``from'' file name is used.
This command is actually a
sends it the
.Ar from
file.
If the
.Ar to
file is not specified, the
.Ar from
file name is used.
this command is actually a
.Ux
specific version of the ``~>'' command.
.It Ic \&~t Ar from Op Ar to
specific version of the
.Ic ~>
command.
.It Ic ~t Ar from Op Ar to
Take a file from a remote
.Ux
host.
As in the put command the ``to'' file
defaults to the ``from'' file name if it isn't specified.
The remote host
executes the command string ``cat 'from';echo ^A'' to send the file to
As in the put command, the
.Ar to
file defaults to the
.Ar from
file name if it is not specified.
The remote host executes the command string
.Dq Nm cat Ar from ; Nm echo Li ^A
to send the file to
.Nm .
.It Ic \&~|
.It Ic ~|
Pipe the output from a remote command to a local
.Ux
process.
The command string sent to the local
.Ux
system is processed by the shell.
.It Ic \&~$
.It Ic ~$
Pipe the output from a local
.Ux
process to the remote host.
The command string sent to the local
.Ux
system is processed by the shell.
.It Ic \&~C
.It Ic ~C
Fork a child process on the local system to perform special protocols
such as \s-1XMODEM\s+1.
such as
.Tn XMODEM .
The child program will be run with the following somewhat unusual
arrangement of file descriptors:
.Bd -literal -offset indent
@ -139,33 +230,34 @@ arrangement of file descriptors:
3 <-> remote tty in
4 <-> remote tty out
.Ed
.It Ic \&~#
.It Ic ~#
Send a
.Dv BREAK
to the remote system.
For systems which don't support the necessary
For systems which do not support the necessary
.Fn ioctl
call the break is simulated by a sequence of line speed changes and
DEL characters.
.It Ic \&~s
.Dv DEL
characters.
.It Ic ~s
Set a variable (see the discussion below).
.It Ic \&~v
.It Ic ~v
List all variables and their values (if set).
.It Ic \&~^Z
.It Ic ~^Z
Stop
.Nm
(only available with job control).
.It Ic \&~^Y
.It Ic ~^Y
Stop only the
.Dq local side
.Dq "local side"
of
.Nm
(only available with job control); the
.Dq remote side
.Dq "remote side"
of
.Nm tip ,
.Nm ,
the side that displays output from the remote host, is left running.
.It Ic \&~?
.It Ic ~?
Get a summary of the tilde escapes.
.El
.Pp
@ -175,7 +267,7 @@ of
.Nm
searches for a system description with a name identical to
.Ar system-name .
The search order is
The search order is as follows:
.Bl -enum -offset indent
.It
If the environment variable
@ -191,7 +283,7 @@ begins with a
it is assumed to be a path to a
.Xr remote 5
database, and the specified database is searched.
.It
.It
The default
.Xr remote 5
database,
@ -199,43 +291,41 @@ database,
is searched.
.El
.Pp
See
.Xr remote 5
for full documentation on system descriptions.
.Pp
The
.Nm
utility uses the file
.Pa /etc/remote
to find how to reach a particular
system and to find out how it should operate while talking
to the system;
refer to
.Xr remote 5
for a full description.
Each system has a default baud rate with which to
establish a connection. If this value is not suitable, the baud rate
to be used may be specified on the command line, e.g.\&
.Ql "tip -300 mds" .
.Va ba
capability is used in system descriptions to specify the baud rate
with which to establish a connection.
If the value specified is not suitable, the baud rate to be used may
be given on the command line, e.g.,
.Dq Li "tip -300 mds" .
.Pp
When
.Nm
establishes a connection it sends out the connection message
establishes a connection, it sends out the connection message
specified in the
.Ar cm
.Va cm
capability of the system description being used.
.Pp
When
.Nm
prompts for an argument (e.g., during setup of a file transfer) the
prompts for an argument (e.g., during setup of a file transfer), the
line typed may be edited with the standard erase and kill characters.
A null line in response to a prompt, or an interrupt, will abort the
dialogue and return you to the remote machine.
.Pp
The
.Nm
utility guards against multiple users connecting to a remote system
by opening modems and terminal lines with exclusive access,
and by honoring the locking protocol used by
utility
guards against multiple users connecting to a remote system by opening
modems and terminal lines with exclusive access, and by honoring the
locking protocol used by
.Xr uucico 8 .
.Pp
During file transfers
During file transfers,
.Nm
provides a running count of the number of lines transferred.
When using the
@ -243,65 +333,73 @@ When using the
and
.Ic ~<
commands, the
.Dq eofread
.Va eofread
and
.Dq eofwrite
.Va eofwrite
variables are used to recognize end-of-file when reading, and specify
end-of-file when writing (see below).
File transfers normally depend on tandem mode for flow control.
If the remote system does not support tandem mode,
.Dq echocheck
may be set to indicate
.Va echocheck
may be set to indicate that
.Nm
should synchronize with the remote system on the echo of each
transmitted character.
.Pp
When
.Nm
must dial a phone number to connect to a system it will print
various messages indicating its actions.
must dial a phone number to connect to a system, it will print various
messages indicating its actions.
The
.Nm
utility supports modems that use the AT command set.
utility
supports a variety of auto-call units and modems with the
.Va at
capability in system descriptions.
.Pp
Support for Ventel 212+ (ventel), Hayes AT-style (hayes),
USRobotics Courier (courier), Telebit T3000 (t3000) and
Racal-Vadic 831 (vadic) units is enabled by default.
.Pp
Support for Bizcomp 1031[fw] (biz31[fw]), Bizcomp 1022[fw]
(biz22[fw]), DEC DF0[23]-AC (df0[23]), DEC DN-11 (dn11) and
Racal-Vadic 3451 (v3451) units can be added by recompiling
.Xr tip 1
with the appropriate defines.
.Pp
Note that if support for both the Racal-Vadic 831 and 3451 is enabled,
they are referred to as the v831 and v3451, respectively.
If only one of the two is supported, it is referred to as vadic.
.Ss Variables
The
.Nm
utility uses the file
.Pa /etc/modems
to find out how to operate with a particular
modem; refer to
.Xr modems 5
for a full description.
.Ss VARIABLES
The
.Nm
utility maintains a set of
.Ar variables
which control its operation.
utility
maintains a set of variables which control its operation.
Some of these variables are read-only to normal users (root is allowed
to change anything of interest).
Variables may be displayed and set through the
.Sq s
.Ic ~s
escape.
The syntax for variables is patterned after
.Xr vi 1
and
.Xr Mail 1 .
Supplying
.Dq all
.Dq Li all
as an argument to the set command displays all variables readable by
the user.
Alternatively, the user may request display of a particular variable
by attaching a
.Ql ?
.Ql \&?
to the end.
For example,
.Dq escape?
.Dq Li escape?
displays the current escape character.
.Pp
Variables are numeric, string, character, or boolean values.
Boolean variables are set merely by specifying their name; they may be
reset by prepending a
.Ql !
.Ql \&!
to the name.
Other variable types are set by concatenating an
.Ql =
@ -311,7 +409,7 @@ A single set command may be used to interrogate as well as set a
number of variables.
Variables may be initialized at run time by placing set commands
(without the
.Ql ~s
.Ic ~s
prefix in a file
.Pa .tiprc
in one's home directory).
@ -323,142 +421,159 @@ to display the sets as they are made.
Certain common variables have abbreviations.
The following is a list of common variables, their abbreviations, and
their default values:
.Bl -tag -width Ar
.It Ar beautify
(bool) Discard unprintable characters when a session is being
.Bl -tag -width indent
.It Va beautify
.Pq Vt bool
Discard unprintable characters when a session is being
scripted; abbreviated
.Ar be .
.It Ar baudrate
(num) The baud rate at which the connection was established;
.Va be .
.It Va baudrate
.Pq Vt num
The baud rate at which the connection was established;
abbreviated
.Ar ba .
.It Ar dialtimeout
(num) When dialing a phone number, the time (in seconds) to wait for a
.Va ba .
.It Va dialtimeout
.Pq Vt num
When dialing a phone number, the time (in seconds) to wait for a
connection to be established; abbreviated
.Ar dial .
.It Ar echocheck
(bool) Synchronize with the remote host during file transfer by
.Va dial .
.It Va echocheck
.Pq Vt bool
Synchronize with the remote host during file transfer by
waiting for the echo of the last character transmitted; default is
.Ar off .
.It Ar eofread
(str) The set of characters which signify an end-of-transmission
.Cm off .
.It Va eofread
.Pq Vt str
The set of characters which signify an end-of-transmission
during a
.Ic ~<
file transfer command; abbreviated
.Ar eofr .
.It Ar eofwrite
(str) The string sent to indicate end-of-transmission during a
.Va eofr .
.It Va eofwrite
.Pq Vt str
The string sent to indicate end-of-transmission during a
.Ic ~>
file transfer command; abbreviated
.Ar eofw .
.It Ar eol
(str) The set of characters which indicate an end-of-line.
.Va eofw .
.It Va eol
.Pq Vt str
The set of characters which indicate an end-of-line.
The
.Nm
utility will recognize escape characters only after an end-of-line.
.It Ar escape
(char) The command prefix (escape) character; abbreviated
.Ar es ;
utility
will recognize escape characters only after an end-of-line.
.It Va escape
.Pq Vt char
The command prefix (escape) character; abbreviated
.Va es ;
default value is
.Ql ~ .
.It Ar exceptions
(str) The set of characters which should not be discarded due to the
.It Va exceptions
.Pq Vt str
The set of characters which should not be discarded due to the
beautification switch; abbreviated
.Ar ex ;
.Va ex ;
default value is
.Dq \et\en\ef\eb .
.It Ar force
(char) The character used to force literal data transmission;
.Dq Li \et\en\ef\eb .
.It Va force
.Pq Vt char
The character used to force literal data transmission;
abbreviated
.Ar fo ;
.Va fo ;
default value is
.Ql ^P .
.It Ar framesize
(num) The amount of data (in bytes) to buffer between filesystem
.It Va framesize
.Pq Vt num
The amount of data (in bytes) to buffer between filesystem
writes when receiving files; abbreviated
.Ar fr .
.It Ar host
(str) The name of the host to which you are connected; abbreviated
.Ar ho .
.It Ar prompt
(char) The character which indicates an end-of-line on the remote
.Va fr .
.It Va host
.Pq Vt str
The name of the host to which you are connected; abbreviated
.Va ho .
.It Va prompt
.Pq Vt char
The character which indicates an end-of-line on the remote
host; abbreviated
.Ar pr ;
.Va pr ;
default value is
.Ql \en .
This value is used to synchronize during data transfers.
The count of lines transferred during a file transfer command is based
on receipt of this character.
.It Ar raise
(bool) Upper case mapping mode; abbreviated
.Ar ra ;
.It Va raise
.Pq Vt bool
Upper case mapping mode; abbreviated
.Va ra ;
default value is
.Ar off .
.Cm off .
When this mode is enabled, all lowercase letters will be mapped to
uppercase by
.Nm
for transmission to the remote machine.
.It Ar raisechar
(char) The input character used to toggle uppercase mapping mode;
.It Va raisechar
.Pq Vt char
The input character used to toggle uppercase mapping mode;
abbreviated
.Ar rc ;
.Va rc ;
default value is
.Ql ^A .
.It Ar record
(str) The name of the file in which a session script is recorded;
.It Va record
.Pq Vt str
The name of the file in which a session script is recorded;
abbreviated
.Ar rec ;
.Va rec ;
default value is
.Dq tip.record .
.It Ar script
(bool) Session scripting mode; abbreviated
.Ar sc ;
.Pa tip.record .
.It Va script
.Pq Vt bool
Session scripting mode; abbreviated
.Va sc ;
default is
.Ar off .
.Cm off .
When
.Ar script
.Va script
is
.Li true ,
.Cm true ,
.Nm
will record everything transmitted by the remote machine in the script
record file specified in
.Ar record .
.Va record .
If the
.Ar beautify
.Va beautify
switch is on, only printable
.Tn ASCII
characters will be included in the script file (those characters
between 040 and 0177).
The variable
.Ar exceptions
.Va exceptions
is used to indicate characters which are an exception to the normal
beautification rules.
.It Ar tabexpand
(bool) Expand tabs to spaces during file transfers; abbreviated
.Ar tab ;
.It Va tabexpand
.Pq Vt bool
Expand tabs to spaces during file transfers; abbreviated
.Va tab ;
default value is
.Ar false .
.Cm false .
Each tab is expanded to 8 spaces.
.It Ar verbose
(bool) Verbose mode; abbreviated
.Ar verb ;
.It Va verbose
.Pq Vt bool
Verbose mode; abbreviated
.Va verb ;
default is
.Ar true .
.Cm true .
When verbose mode is enabled,
.Nm
prints messages while dialing, shows the current number of lines
transferred during a file transfer operations, and more.
.El
.Sh ENVIRONMENT
The
.Nm
utility uses the following environment variables:
.Bl -tag -width Fl
.Bl -tag -width indent
.It Ev SHELL
The name of the shell to use for the
.Ic ~!
command; default value is
.Dq /bin/sh .
.Pa /bin/sh .
.It Ev HOME
The home directory to use for the
.Ic ~c
@ -477,7 +592,7 @@ A path to a
database.
.El
.Sh FILES
.Bl -tag -width "/var/spool/lock/LCK..*" -compact
.Bl -tag -width ".Pa /var/spool/lock/LCK..*" -compact
.It Pa /etc/remote
global
.Xr remote 5
@ -494,7 +609,7 @@ record file
line access log
.It Pa /var/spool/lock/LCK..*
lock file to avoid conflicts with
.Xr uucp
.Xr uucp 1
.El
.Sh SEE ALSO
.Xr phones 5 ,
@ -502,7 +617,7 @@ lock file to avoid conflicts with
.Sh HISTORY
The
.Nm
appeared command in
command appeared in
.Bx 4.2 .
.Sh BUGS
The full set of variables is undocumented and should, probably, be