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