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