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