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