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