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