xref: /dragonfly/usr.bin/tip/tip.1 (revision 9348a738)
1.\" Copyright (c) 1980, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"	@(#)tip.1	8.4 (Berkeley) 4/18/94
29.\" $FreeBSD: src/usr.bin/tip/tip/tip.1,v 1.7.2.7 2002/06/21 15:29:35 charnier Exp $
30.\"
31.Dd April 18, 1994
32.Dt TIP 1
33.Os
34.Sh NAME
35.Nm tip ,
36.Nm cu
37.Nd connect to a remote system
38.Sh SYNOPSIS
39.Nm
40.Op Fl v
41.Fl Ns Ns Ar speed
42.Ar system\-name
43.Nm
44.Op Fl v
45.Fl Ns Ns Ar speed
46.Ar phone\-number
47.Nm cu
48.Op Ar telno
49.Op Fl t
50.Op Fl s Ar speed
51.Op Fl a Ar acu
52.Op Fl l Ar line
53.Op Fl Ar #
54.Sh DESCRIPTION
55The
56.Nm
57and
58.Nm cu
59commands establish a full-duplex connection to another machine,
60giving the appearance of being logged in directly on the
61remote cpu.  It goes without saying that you must have a login
62on the machine (or equivalent) to which you wish to connect.
63The preferred interface is
64.Nm .
65The
66.Nm cu
67interface is included for those people attached to the
68.Dq call Ux
69command of
70.At v7 .
71This manual page
72describes only
73.Nm .
74.Pp
75The options are as follows:
76.Bl -tag -width indent
77.It Fl s Ar speed
78For
79.Nm cu ,
80set the speed of the connection.
81Defaults to 9600.
82.It Fl a Ar acu
83Set the acu.
84.It Fl l Ar line
85For
86.Nm cu ,
87specify the line to use.
88Either of the forms like
89.Pa tty00
90or
91.Pa /dev/tty00
92are permitted.
93.It Fl v
94Set verbose mode.
95.El
96.Pp
97Typed characters are normally transmitted directly to the remote
98machine (which does the echoing as well).  A tilde (`~') appearing
99as the first character of a line is an escape signal; the following
100are recognized:
101.Bl -tag -width flag
102.It Ic \&~^D No or Ic \&~ .
103Drop the connection and exit
104(you may still be logged in on the
105remote machine).
106.It Ic \&~c Op Ar name
107Change directory to
108.Ar name
109(no argument
110implies change to your home directory).
111.It Ic \&~!
112Escape to a shell (exiting the shell will
113return you to tip).
114.It Ic \&~>
115Copy file from local to remote.
116The
117.Nm
118utility prompts for the name of a local file to transmit.
119.It Ic \&~<
120Copy file from remote to local.
121The
122.Nm
123utility prompts first for the name of the file to be sent, then for
124a command to be executed on the remote machine.
125.It Ic \&~p Ar from Op Ar to
126Send a file to a remote
127.Ux
128host.  The put command causes the remote
129.Ux
130system to run the command string ``cat > 'to''', while
131.Nm
132sends it the ``from''
133file.  If the ``to'' file isn't specified the ``from'' file name is used.
134This command is actually a
135.Ux
136specific version of the ``~>'' command.
137.It Ic \&~t Ar from Op Ar to
138Take a file from a remote
139.Ux
140host.
141As in the put command the ``to'' file
142defaults to the ``from'' file name if it isn't specified.
143The remote host
144executes the command string ``cat 'from';echo ^A'' to send the file to
145.Nm .
146.It Ic \&~|
147Pipe the output from a remote command to a local
148.Ux
149process.
150The command string sent to the local
151.Ux
152system is processed by the shell.
153.It Ic \&~$
154Pipe the output from a local
155.Ux
156process to the remote host.
157The command string sent to the local
158.Ux
159system is processed by the shell.
160.It Ic \&~C
161Fork a child process on the local system to perform special protocols
162such as \s-1XMODEM\s+1.  The child program will be run with the following
163somewhat unusual arrangement of file descriptors:
164.Bd -literal -offset indent -compact
1650 <-> local tty in
1661 <-> local tty out
1672 <-> local tty out
1683 <-> remote tty in
1694 <-> remote tty out
170.Ed
171.It Ic \&~#
172Send a
173.Dv BREAK
174to the remote system.
175For systems which don't support the
176necessary
177.Ar ioctl
178call the break is simulated by a sequence of line speed changes
179and
180.Dv DEL
181characters.
182.It Ic \&~s
183Set a variable (see the discussion below).
184.It Ic \&~^Z
185Stop
186.Nm
187(only available with job control).
188.It Ic \&~^Y
189Stop only the ``local side'' of
190.Nm
191(only available with job control);
192the ``remote side'' of
193.Nm ,
194the side that displays output from the remote host, is left running.
195.It Ic \&~?
196Get a summary of the tilde escapes
197.El
198.Pp
199The
200.Nm
201utility uses the file
202.Pa /etc/remote
203to find how to reach a particular
204system and to find out how it should operate while talking
205to the system;
206refer to
207.Xr remote 5
208for a full description.
209Each system has a default baud rate with which to
210establish a connection.  If this value is not suitable, the baud rate
211to be used may be specified on the command line, e.g.\&
212.Ql "tip -300 mds" .
213.Pp
214When
215.Nm
216establishes a connection it sends out a
217connection message to the remote system; the default value, if any,
218is defined in
219.Pa /etc/remote
220(see
221.Xr remote 5 ) .
222.Pp
223When
224.Nm
225prompts for an argument (e.g. during setup of
226a file transfer) the line typed may be edited with the standard
227erase and kill characters.  A null line in response to a prompt,
228or an interrupt, will abort the dialogue and return you to the
229remote machine.
230.Pp
231The
232.Nm
233utility guards against multiple users connecting to a remote system
234by opening modems and terminal lines with exclusive access,
235and by honoring the locking protocol used by
236.Xr uucico 8 .
237.Pp
238During file transfers
239.Nm
240provides a running count of the number of lines transferred.
241When using the ~> and ~< commands, the ``eofread'' and ``eofwrite''
242variables are used to recognize end-of-file when reading, and
243specify end-of-file when writing (see below).  File transfers
244normally depend on tandem mode for flow control.  If the remote
245system does not support tandem mode, ``echocheck'' may be set
246to indicate
247.Nm
248should synchronize with the remote system on the echo of each
249transmitted character.
250.Pp
251When
252.Nm
253must dial a phone number to connect to a system it will print
254various messages indicating its actions.
255The
256.Nm
257utility supports modems that use the AT command set.
258The
259.Nm
260utility uses the file
261.Pa /etc/modems
262to find out how to operate with a particular
263modem; refer to
264.Xr modems 5
265for a full description.
266.Ss VARIABLES
267The
268.Nm
269utility maintains a set of
270.Ar variables
271which control its operation.
272Some of these variables are read-only to normal users (root is allowed
273to change anything of interest).  Variables may be displayed
274and set through the ``s'' escape.  The syntax for variables is patterned
275after
276.Xr vi 1
277and
278.Xr Mail 1 .
279Supplying ``all''
280as an argument to the set command displays all variables readable by
281the user.  Alternatively, the user may request display of a particular
282variable by attaching a `?' to the end.  For example ``escape?''
283displays the current escape character.
284.Pp
285Variables are numeric, string, character, or boolean values.  Boolean
286variables are set merely by specifying their name; they may be reset
287by prepending a `!' to the name.  Other variable types are set by
288concatenating an `=' and the value.  The entire assignment must not
289have any blanks in it.  A single set command may be used to interrogate
290as well as set a number of variables.
291Variables may be initialized at run time by placing set commands
292(without the ``~s'' prefix in a file
293.Pa .tiprc
294in one's home directory).  The
295.Fl v
296option causes
297.Nm
298to display the sets as they are made.
299Certain common variables have abbreviations.
300The following is a list of common variables,
301their abbreviations, and their default values.
302.Bl -tag -width Ar
303.It Ar beautify
304(bool) Discard unprintable characters when a session is being scripted;
305abbreviated
306.Ar be .
307.It Ar baudrate
308(num) The baud rate at which the connection was established;
309abbreviated
310.Ar ba .
311.It Ar chardelay
312(num) Number of milliseconds to delay after the transmission of
313each character;
314abbreviated
315.Ar cdelay .
316.It Ar dialtimeout
317(num) When dialing a phone number, the time (in seconds)
318to wait for a connection to be established; abbreviated
319.Ar dial .
320.It Ar echocheck
321(bool) Synchronize with the remote host during file transfer by
322waiting for the echo of the last character transmitted; default is
323.Ar off .
324.It Ar eofread
325(str) The set of characters which signify an end-of-transmission
326during a ~< file transfer command; abbreviated
327.Ar eofr .
328.It Ar eofwrite
329(str) The string sent to indicate end-of-transmission during
330a ~> file transfer command; abbreviated
331.Ar eofw .
332.It Ar eol
333(str) The set of characters which indicate an end-of-line.
334The
335.Nm
336utility will recognize escape characters only after an end-of-line.
337.It Ar escape
338(char) The command prefix (escape) character; abbreviated
339.Ar es ;
340default value is `~'.
341.It Ar exceptions
342(str) The set of characters which should not be discarded
343due to the beautification switch; abbreviated
344.Ar ex ;
345default value is ``\et\en\ef\eb''.
346.It Ar force
347(char) The character used to force literal data transmission;
348abbreviated
349.Ar fo ;
350default value is `^P'.
351.It Ar framesize
352(num) The amount of data (in bytes) to buffer between file system
353writes when receiving files; abbreviated
354.Ar fr .
355.It Ar host
356(str) The name of the host to which you are connected; abbreviated
357.Ar ho .
358.It Ar linedelay
359(num) Number of milliseconds to delay after the transmission of
360each line;
361abbreviated
362.Ar ldelay .
363.It Ar login
364(str) Pathname of a login shell script to run once connected; standard input
365and output are redirected to the remote host.
366Leading tildes in the pathname
367are expanded expansion; abbreviated
368.Ar li .
369.It Ar logout
370(str) Pathname of a shell script to run before disconnecting; standard input
371and output are redirected to the remote host.
372Leading tildes in the pathname
373are expanded expansion; abbreviated
374.Ar lo .
375.It Ar prompt
376(char) The character which indicates an end-of-line on the remote
377host; abbreviated
378.Ar pr ;
379default value is `\en'.  This value is used to synchronize during
380data transfers.  The count of lines transferred during a file transfer
381command is based on receipt of this character.
382.It Ar raise
383(bool) Upper case mapping mode; abbreviated
384.Ar ra ;
385default value is
386.Ar off .
387When this mode is enabled, all lower case letters will be mapped to
388upper case by
389.Nm
390for transmission to the remote machine.
391.It Ar raisechar
392(char) The input character used to toggle upper case mapping mode;
393abbreviated
394.Ar rc ;
395default value is `^A'.
396.It Ar record
397(str) The name of the file in which a session script is recorded;
398abbreviated
399.Ar rec ;
400default value is ``tip.record''.
401.It Ar script
402(bool) Session scripting mode; abbreviated
403.Ar sc ;
404default is
405.Ar off .
406When
407.Ar script
408is
409.Li true ,
410.Nm
411will record everything transmitted by the remote machine in
412the script record file specified in
413.Ar record .
414If the
415.Ar beautify
416switch is on, only printable
417.Tn ASCII
418characters will be included in
419the script file (those characters between 040 and 0177).  The
420variable
421.Ar exceptions
422is used to indicate characters which are an exception to the normal
423beautification rules.
424.It Ar tabexpand
425(bool) Expand tabs to spaces during file transfers; abbreviated
426.Ar tab ;
427default value is
428.Ar false .
429Each tab is expanded to 8 spaces.
430.It Ar verbose
431(bool) Verbose mode; abbreviated
432.Ar verb ;
433default is
434.Ar true .
435When verbose mode is enabled,
436.Nm
437prints messages while dialing, shows the current number
438of lines transferred during a file transfer operations,
439and more.
440.El
441.Sh ENVIRONMENT
442The
443.Nm
444utility uses the following environment variables:
445.Bl -tag -width Fl
446.It Ev SHELL
447(str) The name of the shell to use for the ~! command; default
448value is ``/bin/sh'', or taken from the environment.
449.It Ev HOME
450(str) The home directory to use for the ~c command; default
451value is taken from the environment.
452.It Ev HOST
453Check for a default host if none specified.
454.El
455.Pp
456The variables
457.Ev ${REMOTE}
458and
459.Ev ${PHONES}
460are also exported.
461.Sh FILES
462.Bl -tag -width /var/spool/lock/LCK..* -compact
463.It Pa /etc/modems
464Global modem configuration data base.
465.It Pa /etc/remote
466Global system descriptions.
467.It Pa /etc/phones
468Global phone number data base.
469.It Ev ${REMOTE}
470Private system descriptions.
471.It Ev ${PHONES}
472Private phone numbers.
473.It Pa ~/.tiprc
474Initialization file.
475.It Pa tip.record
476Record file.
477.It Pa /var/log/aculog
478Line access log.
479.It Pa /var/spool/lock/LCK..*
480Lock file to avoid conflicts with
481.Xr uucp 1 .
482.El
483.Sh DIAGNOSTICS
484Diagnostics are, hopefully, self explanatory.
485.Sh SEE ALSO
486.Xr phones 5 ,
487.Xr remote 5
488.Sh HISTORY
489The
490.Nm
491command appeared in
492.Bx 4.2 .
493.Sh BUGS
494The full set of variables is undocumented and should, probably, be
495pared down.
496