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