1.\" $NetBSD: tip.1,v 1.15 2002/05/03 22:43:59 mjl Exp $ 2.\" 3.\" Copyright (c) 1980, 1990, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by the University of 17.\" California, Berkeley and its contributors. 18.\" 4. Neither the name of the University nor the names of its contributors 19.\" may be used to endorse or promote products derived from this software 20.\" without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" @(#)tip.1 8.4 (Berkeley) 4/18/94 35.\" 36.Dd April 18, 1994 37.Dt TIP 1 38.Os 39.Sh NAME 40.Nm tip 41.\" .Nm cu 42.Nd connect to a remote system 43.Sh SYNOPSIS 44.Nm 45.Op Fl v 46.Fl Ns Ns Ar speed 47.Ar system\-name 48.Nm "" 49.Op Fl v 50.Fl Ns Ns Ar speed 51.Ar phone\-number 52.\" .Nm cu 53.\" .Ar phone\-number 54.\" .Op Fl t 55.\" .Op Fl s Ar speed 56.\" .Op Fl a Ar acu 57.\" .Op Fl l Ar line 58.\" .Op Fl # 59.Sh DESCRIPTION 60.Nm 61.\" and 62.\" .Nm cu 63establish a full-duplex connection to another machine, 64giving the appearance of being logged in directly on the 65remote cpu. It goes without saying that you must have a login 66on the machine (or equivalent) to which you wish to connect. 67.\" The preferred interface is 68.\" .Nm tip . 69.\" The 70.\" .Nm cu 71.\" interface is included for those people attached to the 72.\" ``call 73.\" .Ux Ns '' 74.\" command of version 7. This manual page 75.\" describes only 76.\" .Nm tip . 77.Pp 78Available Option: 79.Bl -tag -width indent 80.It Fl v 81Set verbose mode. 82.El 83.Pp 84Typed characters are normally transmitted directly to the remote 85machine (which does the echoing as well). A tilde (`~') appearing 86as the first character of a line is an escape signal; the following 87are recognized: 88.Bl -tag -width flag 89.It Ic \&~^D No or Ic \&~ . 90Drop the connection and exit 91(you may still be logged in on the 92remote machine). 93.It Ic \&~c Op Ar name 94Change directory to 95.Ar name 96(no argument 97implies change to your home directory). 98.It Ic \&~! 99Escape to a shell (exiting the shell will 100return you to tip). 101.It Ic \&~\*[Gt] 102Copy file from local to remote. 103.Nm 104prompts for the name of a local file to transmit. 105.It Ic \&~\*[Lt] 106Copy file from remote to local. 107.Nm 108prompts first for the name of the file to be sent, then for 109a command to be executed on the remote machine. 110.It Ic \&~p Ar from Op Ar to 111Send a file to a remote 112.Ux 113host. The put command causes the remote 114.Ux 115system to run the command string ``cat \*[Gt] 'to''', while 116.Nm 117sends it the ``from'' 118file. If the ``to'' file isn't specified the ``from'' file name is used. 119This command is actually a 120.Ux 121specific version of the ``~\*[Gt]'' command. 122.It Ic \&~t Ar from Op Ar to 123Take a file from a remote 124.Ux 125host. 126As in the put command the ``to'' file 127defaults to the ``from'' file name if it isn't specified. 128The remote host 129executes the command string ``cat 'from';echo ^A'' to send the file to 130.Nm "" . 131.It Ic \&~| 132Pipe the output from a remote command to a local 133.Ux 134process. 135The command string sent to the local 136.Ux 137system is processed by the shell. 138.It Ic \&~$ 139Pipe the output from a local 140.Ux 141process to the remote host. 142The command string sent to the local 143.Ux 144system is processed by the shell. 145.It Ic \&~C 146Fork a child process on the local system to perform special protocols 147such as \s-1XMODEM\s+1. The child program will be run with the following 148somewhat unusual arrangement of file descriptors: 149.nf 150.in +1i 1510 \*[Lt]-\*[Gt] local tty in 1521 \*[Lt]-\*[Gt] local tty out 1532 \*[Lt]-\*[Gt] local tty out 1543 \*[Lt]-\*[Gt] remote tty in 1554 \*[Lt]-\*[Gt] remote tty out 156.in -1i 157.fi 158.It Ic \&~# 159Send a 160.Dv BREAK 161to the remote system. 162For systems which don't support the 163necessary 164.Ar ioctl 165call the break is simulated by a sequence of line speed changes 166and 167.Dv DEL 168characters. 169.It Ic \&~s 170Set a variable (see the discussion below). 171.It Ic \&~^Z 172Stop 173.Nm 174(only available with job control). 175.It Ic \&~^Y 176Stop only the ``local side'' of 177.Nm 178(only available with job control); 179the ``remote side'' of 180.Nm "" , 181the side that displays output from the remote host, is left running. 182.It Ic \&~? 183Get a summary of the tilde escapes 184.El 185.Pp 186.Nm 187uses the file 188.Pa /etc/remote 189to find how to reach a particular 190system and to find out how it should operate while talking 191to the system; 192refer to 193.Xr remote 5 194for a full description. 195Each system has a default baud rate with which to 196establish a connection. If this value is not suitable, the baud rate 197to be used may be specified on the command line, e.g. 198.Ql "tip -300 mds" . 199.Pp 200When 201.Nm 202establishes a connection it sends out a 203connection message to the remote system; the default value, if any, 204is defined in 205.Pa /etc/remote 206(see 207.Xr remote 5 ) . 208.Pp 209When 210.Nm 211prompts for an argument (e.g. during setup of 212a file transfer) the line typed may be edited with the standard 213erase and kill characters. A null line in response to a prompt, 214or an interrupt, will abort the dialogue and return you to the 215remote machine. 216.Pp 217.Nm 218guards against multiple users connecting to a remote system 219by opening modems and terminal lines with exclusive access, 220and by honoring the locking protocol used by 221.Xr uucico 8 . 222.Pp 223During file transfers 224.Nm 225provides a running count of the number of lines transferred. 226When using the ~\*[Gt] and ~\*[Lt] commands, the ``eofread'' and ``eofwrite'' 227variables are used to recognize end-of-file when reading, and 228specify end-of-file when writing (see below). File transfers 229normally depend on tandem mode for flow control. If the remote 230system does not support tandem mode, ``echocheck'' may be set 231to indicate 232.Nm 233should synchronize with the remote system on the echo of each 234transmitted character. 235.Pp 236When 237.Nm 238must dial a phone number to connect to a system it will print 239various messages indicating its actions. 240.Nm 241supports the 242.Tn DEC DN Ns -11 243and 244Racal-Vadic 831 auto-call-units; 245the 246.Tn DEC DF Ns \&02 247and 248.Tn DF Ns \&03 , 249Ventel 212+, Racal-Vadic 3451, and 250Bizcomp 1031 and 1032 integral call unit/modems. 251.Ss VARIABLES 252.Nm 253maintains a set of 254.Ar variables 255which control its operation. 256Some of these variables are read-only to normal users (root is allowed 257to change anything of interest). Variables may be displayed 258and set through the ``s'' escape. The syntax for variables is patterned 259after 260.Xr vi 1 261and 262.Xr Mail 1 . 263Supplying ``all'' 264as an argument to the set command displays all variables readable by 265the user. Alternatively, the user may request display of a particular 266variable by attaching a `?' to the end. For example ``escape?'' displays 267the current escape character. 268.Pp 269Variables are numeric, string, character, or boolean values. Boolean 270variables are set merely by specifying their name; they may be reset 271by prepending a `!' to the name. Other variable types are set by 272concatenating an `=' and the value. The entire assignment must not 273have any blanks in it. A single set command may be used to interrogate 274as well as set a number of variables. 275Variables may be initialized at run time by placing set commands 276(without the ``~s'' prefix in a file 277.Pa .tiprc 278in one's home directory). The 279.Fl v 280option causes 281.Nm 282to display the sets as they are made. 283Certain common variables have abbreviations. 284The following is a list of common variables, 285their abbreviations, and their default values. 286.Bl -tag -width Ar 287.It Ar beautify 288(bool) Discard unprintable characters when a session is being scripted; 289abbreviated 290.Ar be . 291.It Ar baudrate 292(num) The baud rate at which the connection was established; 293abbreviated 294.Ar ba . 295.It Ar dialtimeout 296(num) When dialing a phone number, the time (in seconds) 297to wait for a connection to be established; abbreviated 298.Ar dial . 299.It Ar echocheck 300(bool) Synchronize with the remote host during file transfer by 301waiting for the echo of the last character transmitted; default is 302.Ar off . 303.It Ar eofread 304(str) The set of characters which signify an end-of-transmission 305during a ~\*[Lt] file transfer command; abbreviated 306.Ar eofr . 307.It Ar eofwrite 308(str) The string sent to indicate end-of-transmission during 309a ~\*[Gt] file transfer command; abbreviated 310.Ar eofw . 311.It Ar eol 312(str) The set of characters which indicate an end-of-line. 313.Nm 314will recognize escape characters only after an end-of-line. 315.It Ar escape 316(char) The command prefix (escape) character; abbreviated 317.Ar es ; 318default value is `~'. 319.It Ar exceptions 320(str) The set of characters which should not be discarded 321due to the beautification switch; abbreviated 322.Ar ex ; 323default value is ``\et\en\ef\eb''. 324.It Ar force 325(char) The character used to force literal data transmission; 326abbreviated 327.Ar fo ; 328default value is `^P'. 329.It Ar framesize 330(num) The amount of data (in bytes) to buffer between file system 331writes when receiving files; abbreviated 332.Ar fr . 333.It Ar host 334(str) The name of the host to which you are connected; abbreviated 335.Ar ho . 336.It Ar prompt 337(char) The character which indicates an end-of-line on the remote 338host; abbreviated 339.Ar pr ; 340default value is `\en'. This value is used to synchronize during 341data transfers. The count of lines transferred during a file transfer 342command is based on receipt of this character. 343.It Ar raise 344(bool) Upper case mapping mode; abbreviated 345.Ar ra ; 346default value is 347.Ar off . 348When this mode is enabled, all lower case letters will be mapped to 349upper case by 350.Nm 351for transmission to the remote machine. 352.It Ar raisechar 353(char) The input character used to toggle upper case mapping mode; 354abbreviated 355.Ar rc ; 356default value is `^A'. 357.It Ar record 358(str) The name of the file in which a session script is recorded; 359abbreviated 360.Ar rec ; 361default value is ``tip.record''. 362.It Ar script 363(bool) Session scripting mode; abbreviated 364.Ar sc ; 365default is 366.Ar off . 367When 368.Ar script 369is 370.Li true , 371.Nm 372will record everything transmitted by the remote machine in 373the script record file specified in 374.Ar record . 375If the 376.Ar beautify 377switch is on, only printable 378.Tn ASCII 379characters will be included in 380the script file (those characters between 040 and 0177). The 381variable 382.Ar exceptions 383is used to indicate characters which are an exception to the normal 384beautification rules. 385.It Ar tabexpand 386(bool) Expand tabs to spaces during file transfers; abbreviated 387.Ar tab ; 388default value is 389.Ar false . 390Each tab is expanded to 8 spaces. 391.It Ar verbose 392(bool) Verbose mode; abbreviated 393.Ar verb ; 394default is 395.Ar true . 396When verbose mode is enabled, 397.Nm 398prints messages while dialing, shows the current number 399of lines transferred during a file transfer operations, 400and more. 401.El 402.Sh ENVIRONMENT 403.Nm 404uses the following environment variables: 405.Bl -tag -width Fl 406.It Ev SHELL 407(str) The name of the shell to use for the ~! command; default 408value is ``/bin/sh'', or taken from the environment. 409.It Ev HOME 410(str) The home directory to use for the ~c command; default 411value is taken from the environment. 412.It Ev HOST 413Check for a default host if none specified. 414.El 415.Pp 416The variables 417.Ev ${REMOTE} 418and 419.Ev ${PHONES} 420are also exported. 421.Sh FILES 422.Bl -tag -width /var/spool/lock/LCK..* -compact 423.It Pa /etc/remote 424Global system descriptions. 425.It Pa /etc/phones 426Global phone number data base. 427.It ${REMOTE} 428Private system descriptions. 429.It ${PHONES} 430Private phone numbers. 431.It ~/.tiprc 432Initialization file. 433.It Pa tip.record 434Record file. 435.It /var/log/aculog 436Line access log. 437.It Pa /var/spool/lock/LCK..* 438Lock file to avoid conflicts with 439.Xr uucp 1 . 440.El 441.Sh DIAGNOSTICS 442Diagnostics are, hopefully, self explanatory. 443.Sh SEE ALSO 444.Xr phones 5 , 445.Xr remote 5 446.Sh HISTORY 447The 448.Nm 449command appeared in 450.Bx 4.2 . 451.Sh BUGS 452The full set of variables is undocumented and should, probably, be 453pared down. 454