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