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