1.\"	$OpenBSD: tip.1,v 1.34 2005/04/08 19:29:12 jmc Exp $
2.\"	$NetBSD: tip.1,v 1.7 1994/12/08 09:31:05 jtc Exp $
3.\"
4.\" Copyright (c) 1980, 1990, 1993
5.\"	The Regents of the University of California.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\"	@(#)tip.1	8.4 (Berkeley) 4/18/94
32.\"
33.Dd September 9, 2001
34.Dt TIP 1
35.Os
36.Sh NAME
37.Nm tip ,
38.Nm cu
39.Nd connect to a remote system
40.Sh SYNOPSIS
41.Nm tip
42.Op Fl nv
43.Op Fl Ar speed
44.Op Ar system\-name
45.Nm cu
46.Op Fl ehot
47.Op Fl a Ar acu
48.Op Fl l Ar line
49.Op Fl s Ar speed
50.Op Fl #
51.Op Ar phone\-number
52.Sh DESCRIPTION
53.Nm
54and
55.Nm cu
56establish a full-duplex connection to another machine, giving the
57appearance of being logged in directly on the remote CPU.
58It goes without saying that you must have a login on the machine (or
59equivalent) to which you wish to connect.
60The preferred interface is
61.Nm tip .
62The
63.Nm cu
64interface is included for those people attached to the
65``call
66.Ux Ns ''
67command of
68.At v7 .
69This manual page
70describes only
71.Nm tip .
72.Pp
73The options are as follows:
74.Bl -tag -width 4n
75.It Fl a Ar acu
76Set the acu.
77.It Fl e
78For
79.Nm cu ,
80use even parity.
81.It Fl h
82For
83.Nm cu ,
84echo characters locally (half-duplex mode).
85.It Fl l Ar line
86For
87.Nm cu ,
88specify the line to use.
89Either of the forms like
90.Pa tty00
91or
92.Pa /dev/tty00
93are permitted.
94.It Fl n
95No escape (disable tilde).
96.It Fl o
97For
98.Nm cu ,
99use odd parity.
100.It Fl s Ar speed
101For
102.Nm cu ,
103set the speed of the connection.
104Defaults to 9600.
105.It Fl t
106For
107.Nm cu ,
108connect via a hard-wired connection to a host on a dial-up line.
109.It Fl v
110Set verbose mode.
111.El
112.Pp
113For
114.Nm cu ,
115if both
116.Fl e
117and
118.Fl o
119are given, then no parity is used.
120This is the default behaviour.
121.Pp
122If
123.Ar speed
124is specified it will override any baudrate specified in the system
125description being used.
126.Pp
127If neither
128.Ar speed
129nor
130.Ar system-name
131are specified,
132.Ar system-name
133will be set to the value of the
134.Ev HOST
135environment variable.
136.Pp
137If
138.Ar speed
139is specified but
140.Ar system-name
141is not,
142.Ar system-name
143will be set to a value of 'tip' with
144.Ar speed
145appended.
146e.g.\&
147.Ic tip -1200
148will set
149.Ar system-name
150to 'tip1200'.
151.Pp
152Typed characters are normally transmitted directly to the remote
153machine (which does the echoing as well).
154A tilde
155.Pq Ql ~
156appearing as the first character of a line is an escape signal; the
157following are recognized:
158.Bl -tag -offset indent -width Fl
159.It Ic \&~^D No or Ic \&~.
160Drop the connection and exit (you may still be logged in on the remote
161machine).
162.It Ic \&~c Op Ar name
163Change directory to
164.Ar name
165(no argument implies change to your home directory).
166.It Ic \&~!
167Escape to a shell (exiting the shell will return you to
168.Nm tip ) .
169.It Ic \&~>
170Copy file from local to remote.
171.Nm
172prompts for the name of a local file to transmit.
173.It Ic \&~<
174Copy file from remote to local.
175.Nm
176prompts first for the name of the file to be sent, then for a command
177to be executed on the remote machine.
178.It Ic \&~p Ar from Op Ar to
179Send a file to a remote
180.Ux
181host.
182The put command causes the remote
183.Ux
184system to run the command string
185.Ic cat > 'to' ,
186while
187.Nm
188sends it the
189.Dq from
190file.
191If the
192.Dq to
193file isn't specified the
194.Dq from
195file name is used.
196This command is actually a
197.Ux
198specific version of the
199.Ic ~>
200command.
201.It Ic \&~t Ar from Op Ar to
202Take a file from a remote
203.Ux
204host.
205As in the put command the
206.Dq to
207file defaults to the
208.Dq from
209file name if it isn't specified.
210The remote host executes the command string
211.Ic cat 'from';echo ''|tr '\e012' '\e01'
212to send the file to
213.Nm tip .
214.It Ic \&~|
215Pipe the output from a remote command to a local
216.Ux
217process.
218The command string sent to the local
219.Ux
220system is processed by the shell.
221.It Ic \&~$
222Pipe the output from a local
223.Ux
224process to the remote host.
225The command string sent to the local
226.Ux
227system is processed by the shell.
228.It Ic \&~C
229Fork a child process on the local system to perform special protocols
230such as \s-1XMODEM\s+1.
231The child program will be run with the following arrangement of
232file descriptors:
233.Bd -literal -offset indent
2340 <-> remote tty in
2351 <-> remote tty out
2362 <-> local tty stderr
237.Ed
238.It Ic \&~#
239Send a
240.Dv BREAK
241to the remote system.
242For systems which don't support the necessary
243.Fn ioctl
244call the break is simulated by a sequence of line speed changes and
245DEL characters.
246.It Ic \&~s
247Set a variable (see the discussion below).
248.It Ic \&~v
249List all variables and their values (if set).
250.It Ic \&~^Z
251Stop
252.Nm
253(only available with job control).
254.It Ic \&~^Y
255Stop only the
256.Dq local side
257of
258.Nm
259(only available with job control); the
260.Dq remote side
261of
262.Nm tip ,
263the side that displays output from the remote host, is left running.
264.It Ic \&~?
265Get a summary of the tilde escapes.
266.El
267.Pp
268To find the system description and thus the operating characteristics
269of
270.Ar system-name ,
271.Nm
272searches for a system description with a name identical to
273.Ar system-name .
274The search order is
275.Bl -enum -offset indent
276.It
277If the environment variable
278.Ev REMOTE
279does not start with a
280.Ql \&/
281it is assumed to be a system description, and is considered first.
282.It
283If the environment variable
284.Ev REMOTE
285begins with a
286.Ql \&/
287it is assumed to be a path to a
288.Xr remote 5
289database, and the specified database is searched.
290.It
291The default
292.Xr remote 5
293database,
294.Pa /etc/remote ,
295is searched.
296.El
297.Pp
298See
299.Xr remote 5
300for full documentation on system descriptions.
301.Pp
302The
303.Ar br
304capability is used in system descriptions to specify the baud rate
305with which to establish a connection.
306If the value specified is not suitable, the baud rate to be used may
307be given on the command line, e.g.,
308.Ql "tip -300 mds" .
309.Pp
310When
311.Nm
312establishes a connection it sends out the connection message
313specified in the
314.Ar cm
315capability of the system description being used.
316.Pp
317When
318.Nm
319prompts for an argument (e.g., during setup of a file transfer) the
320line typed may be edited with the standard erase and kill characters.
321A null line in response to a prompt, or an interrupt, will abort the
322dialogue and return you to the remote machine.
323.Pp
324.Nm
325guards against multiple users connecting to a remote system by opening
326modems and terminal lines with exclusive access, and by honoring the
327locking protocol used by
328.Xr uucico .
329.Pp
330During file transfers
331.Nm
332provides a running count of the number of lines transferred.
333When using the
334.Ic ~>
335and
336.Ic ~<
337commands, the
338.Dq eofread
339and
340.Dq eofwrite
341variables are used to recognize end-of-file when reading, and specify
342end-of-file when writing (see below).
343File transfers normally depend on hardwareflow or tandem mode for flow control.
344If the remote system does not support hardwareflow or tandem mode,
345.Dq echocheck
346may be set to indicate
347.Nm
348should synchronize with the remote system on the echo of each
349transmitted character.
350.Pp
351When
352.Nm
353must dial a phone number to connect to a system it will print various
354messages indicating its actions.
355.Nm
356supports a variety of auto-call units and modems with the
357.Ar at
358capability in system descriptions.
359.Pp
360Support for Ventel 212+	(ventel), Hayes AT-style (hayes),
361USRobotics Courier (courier), Telebit T3000 (t3000) and
362Racal-Vadic 831 (vadic) units is enabled by default.
363.Pp
364Support for Bizcomp 1031[fw] (biz31[fw]), Bizcomp 1022[fw]
365(biz22[fw]), DEC DF0[23]-AC (df0[23]), DEC DN-11 (dn11) and
366Racal-Vadic 3451 (v3451) units can be added by recompiling
367.Nm tip
368with the appropriate defines.
369.Pp
370Note that if support for both the Racal-Vadic 831 and 3451 is enabled
371they are referred to as the v831 and v3451 respectively.
372If only one of the two is supported, it is referred to as vadic.
373.Ss VARIABLES
374.Nm
375maintains a set of variables which control its operation.
376Some of these variables are read-only to normal users (root is allowed
377to change anything of interest).
378Variables may be displayed and set through the
379.Sq s
380escape.
381The syntax for variables is patterned after
382.Xr vi 1
383and
384.Xr Mail 1 .
385Supplying
386.Dq all
387as an argument to the set command displays all variables readable by
388the user.
389Alternatively, the user may request display of a particular variable
390by attaching a
391.Ql \&?
392to the end.
393For example,
394.Dq escape?
395displays the current escape character.
396.Pp
397Variables are numeric, string, character, or boolean values.
398Boolean variables are set merely by specifying their name; they may be
399reset by prepending a
400.Ql \&!
401to the name.
402Other variable types are set by concatenating an
403.Ql =
404and the value.
405The entire assignment must not have any blanks in it.
406A single set command may be used to interrogate as well as set a
407number of variables.
408Variables may be initialized at run time by placing set commands
409(without the
410.Ql ~s
411prefix in a file
412.Pa .tiprc
413in one's home directory).
414The
415.Fl v
416option causes
417.Nm
418to display the sets as they are made.
419Certain common variables have abbreviations.
420The following is a list of common variables, their abbreviations, and
421their default values:
422.Bl -tag -width Ar
423.It Ar beautify
424(bool) Discard unprintable characters when a session is being
425scripted; abbreviated
426.Ar be .
427.It Ar baudrate
428(num) The baud rate at which the connection was established;
429abbreviated
430.Ar ba .
431.It Ar dialtimeout
432(num) When dialing a phone number, the time (in seconds) to wait for a
433connection to be established; abbreviated
434.Ar dial .
435.It Ar echocheck
436(bool) Synchronize with the remote host during file transfer by
437waiting for the echo of the last character transmitted; default is
438.Ar off .
439.It Ar eofread
440(str) The set of characters which signify an end-of-transmission
441during a
442.Ic ~<
443file transfer command; abbreviated
444.Ar eofr .
445.It Ar eofwrite
446(str) The string sent to indicate end-of-transmission during a
447.Ic ~>
448file transfer command; abbreviated
449.Ar eofw .
450.It Ar eol
451(str) The set of characters which indicate an end-of-line.
452.Nm
453will recognize escape characters only after an end-of-line.
454.It Ar escape
455(char) The command prefix (escape) character; abbreviated
456.Ar es ;
457default value is
458.Ql ~ .
459.It Ar exceptions
460(str) The set of characters which should not be discarded due to the
461beautification switch; abbreviated
462.Ar ex ;
463default value is
464.Dq \et\en\ef\eb .
465.It Ar force
466(char) The character used to force literal data transmission;
467abbreviated
468.Ar fo ;
469default value is
470.Ql ^P .
471.It Ar framesize
472(num) The amount of data (in bytes) to buffer between filesystem
473writes when receiving files; abbreviated
474.Ar fr .
475.It Ar hardwareflow
476(bool) Whether hardware flow control (CRTSCTS) is enabled for the
477connection; abbreviated
478.Ar hf ;
479default value is
480.Ql off .
481.It Ar host
482(str) The name of the host to which you are connected; abbreviated
483.Ar ho .
484.It Ar prompt
485(char) The character which indicates an end-of-line on the remote
486host; abbreviated
487.Ar pr ;
488default value is
489.Ql \en .
490This value is used to synchronize during data transfers.
491The count of lines transferred during a file transfer command is based
492on receipt of this character.
493.It Ar raise
494(bool) Upper case mapping mode; abbreviated
495.Ar ra ;
496default value is
497.Ar off .
498When this mode is enabled, all lowercase letters will be mapped to
499uppercase by
500.Nm
501for transmission to the remote machine.
502.It Ar raisechar
503(char) The input character used to toggle uppercase mapping mode;
504abbreviated
505.Ar rc ;
506default value is
507.Ql ^A .
508.It Ar record
509(str) The name of the file in which a session script is recorded;
510abbreviated
511.Ar rec ;
512default value is
513.Dq tip.record .
514.It Ar script
515(bool) Session scripting mode; abbreviated
516.Ar sc ;
517default is
518.Ar off .
519When
520.Ar script
521is
522.Li true ,
523.Nm
524will record everything transmitted by the remote machine in the script
525record file specified in
526.Ar record .
527If the
528.Ar beautify
529switch is on, only printable
530.Tn ASCII
531characters will be included in the script file (those characters
532between 040 and 0177).
533The variable
534.Ar exceptions
535is used to indicate characters which are an exception to the normal
536beautification rules.
537.It Ar tabexpand
538(bool) Expand tabs to spaces during file transfers; abbreviated
539.Ar tab ;
540default value is
541.Ar false .
542Each tab is expanded to 8 spaces.
543.It Ar tandem
544(bool) Use XON/XOFF flow control to throttle data from the remote host;
545abbreviated
546.Ar ta .
547The default value is
548.Ar true
549unless the
550.Ar nt
551capability has been specified in
552.Pa /etc/remote ,
553in which case the default value is
554.Ar false .
555.It Ar verbose
556(bool) Verbose mode; abbreviated
557.Ar verb ;
558default is
559.Ar true .
560When verbose mode is enabled,
561.Nm
562prints messages while dialing, shows the current number of lines
563transferred during a file transfer operations, and more.
564.El
565.Sh ENVIRONMENT
566.Bl -tag -width Fl
567.It Ev SHELL
568The name of the shell to use for the
569.Ic ~!\&
570command; default value is
571.Dq /bin/sh .
572.It Ev HOME
573The home directory to use for the
574.Ic ~c
575command.
576.It Ev HOST
577The default value for
578.Ar system-name
579if none is specified via the command line.
580.It Ev REMOTE
581A system description, or an absolute path to a
582.Xr remote 5
583system description database.
584.It Ev PHONES
585A path to a
586.Xr phones 5
587database.
588.El
589.Sh FILES
590.Bl -tag -width "/var/spool/lock/LCK..*" -compact
591.It Pa /etc/remote
592global
593.Xr remote 5
594database
595.It Pa /etc/phones
596default
597.Xr phones 5
598file
599.It Pa ~/.tiprc
600initialization file
601.It Pa tip.record
602record file
603.It Pa /var/log/aculog
604line access log
605.It Pa /var/spool/lock/LCK..*
606lock file to avoid conflicts with
607.Xr uucp
608.El
609.Sh SEE ALSO
610.Xr phones 5 ,
611.Xr remote 5
612.Sh HISTORY
613The
614.Nm
615command appeared in
616.Bx 4.2 .
617.Sh BUGS
618The full set of variables is undocumented and should, probably, be
619pared down.
620