1cu(1C) Communication Commands cu(1C)
2
3
4
6 cu - call another UNIX system
7
9 cu [-c device | -l line] [-s speed] [-b bits] [-h] [-n]
10 [-t] [-d] [-o | -e] [-L] [-C] [-H] telno | systemname
11 [local-cmd]
12
13
15 The command cu calls up another UNIX system, a terminal, or possibly a
16 non-UNIX system. It manages an interactive conversation with possible
17 transfers of files. It is convenient to think of cu as operating in two
18 phases. The first phase is the connection phase in which the connection
19 is established. cu then enters the conversation phase. The -d option is
20 the only one that applies to both phases.
21
23 cu accepts many options. The -c, -l, and -s options play a part in
24 selecting the medium. The remaining options are used in configuring the
25 line.
26
27 -b bits Forces bits to be the number of bits processed on the
28 line. bits is either 7 or 8. This allows connection
29 between systems with different character sizes. By
30 default, the character size of the line is set to the same
31 value as the current local terminal, but the character
32 size setting is affected by LC_CTYPE also.
33
34
35 -c device Forces cu to use only entries in the "Type" field (the
36 first field in the /etc/uucp/Devices file) that match the
37 user specified device, usually the name of a local area
38 network.
39
40
41 -C Runs the local-cmd specified at the end of the command
42 line instead of entering interactive mode. The stdin and
43 stdout of the command that is run refer to the remote con‐
44 nection.
45
46
47 -d Prints diagnostic traces.
48
49
50 -e Sets an EVEN data parity. This option designates that
51 EVEN parity is to be generated for data sent to the remote
52 system.
53
54
55 -h Sets communication mode to half-duplex. This option emu‐
56 lates local echo in order to support calls to other com‐
57 puter systems that expect terminals to be set to half-
58 duplex mode.
59
60
61 -H Ignores one hangup. This allows the user to remain in cu
62 while the remote machine disconnects and places a call
63 back to the local machine. This option should be used
64 when connecting to systems with callback or dialback
65 modems. Once the callback occurs subsequent hangups will
66 cause cu to terminate. This option can be specified more
67 than once. For more information about dialback configura‐
68 tion, see remote(4) and System Administration Guide: IP
69 Services
70
71
72 -l line Specifies a device name to use as the communication line.
73 This can be used to override the search that would other‐
74 wise take place for the first available line having the
75 right speed. When the -l option is used without the -s
76 option, the speed of a line is taken from the
77 /etc/uucp/Devices file record in which line matches the
78 second field (the Line field). When the -l and -s options
79 are both used together, cu will search the
80 /etc/uucp/Devices file to check if the requested speed for
81 the requested line is available. If so, the connection
82 will be made at the requested speed, otherwise, an error
83 message will be printed and the call will not be made. In
84 the general case where a specified device is a directly
85 connected asynchronous line (for instance, /dev/term/a), a
86 telephone number (telno) is not required. The specified
87 device need not be in the /dev directory. If the specified
88 device is associated with an auto dialer, a telephone num‐
89 ber must be provided.
90
91
92 -L Goes through the login chat sequence specified in the
93 /etc/uucp/Systems file. For more information about the
94 chat sequence, see System Administration Guide: IP Ser‐
95 vices
96
97
98 -n Requests user prompt for telephone number. For added
99 security, this option will prompt the user to provide the
100 telephone number to be dialed, rather than taking it from
101 the command line.
102
103
104 -o Sets an ODD data parity. This option designates that ODD
105 parity is to be generated for data sent to the remote sys‐
106 tem.
107
108
109 -s speed Specifies the transmission speed (300, 1200, 2400, 4800,
110 9600, 19200, 38400). The default value is "Any" speed
111 which will depend on the order of the lines in the
112 /etc/uucp/Devices file.
113
114
115 -t Dials a terminal which has been set to auto answer. Appro‐
116 priate mapping of carriage-return to carriage-return-line-
117 feed pairs is set.
118
119
121 The following operands are supported:
122
123 telno When using an automatic dialler, specifies the telephone
124 number with equal signs for secondary dial tone or minus
125 signs placed appropriately for delays of 4 seconds.
126
127
128 systemname Specifies a uucp system name, which can be used rather
129 than a telephone number; in this case, cu will obtain an
130 appropriate direct line or telephone number from a system
131 file.
132
133
135 Connection Phase
136 cu uses the same mechanism that uucp(1C) does to establish a connec‐
137 tion. This means that it will use the uucp control files
138 /etc/uucp/Devices and /etc/uucp/Systems. This gives cu the ability to
139 choose from several different media to establish the connection. The
140 possible media include telephone lines, direct connections, and local
141 area networks (LAN). The /etc/uucp/Devices file contains a list of
142 media that are available on your system. The /etc/uucp/Systems file
143 contains information for connecting to remote systems, but it is not
144 generally readable.
145
146
147 Note: cu determines which /etc/uucp/Systems and /etc/uucp/Devices files
148 to use based upon the name used to invoke cu. In the simple case, this
149 name will be "cu", but you could also have created a link to cu with
150 another name, such as "pppcu", in which case cu would then look for a
151 "service=pppcu" entry in the /etc/uucp/Sysfiles file to determine
152 which /etc/uucp/Systems file to use.
153
154
155 The telno or systemname parameter from the command line is used to tell
156 cu what system you wish to connect to. This parameter can be blank, a
157 telephone number, a system name, or a LAN specific address.
158
159 telephone number A telephone number is a string consisting of the
160 tone dial characters (the digits 0 through 9, *,
161 and #) plus the special characters = and −. The
162 equal sign designates a secondary dial tone and the
163 minus sign creates a 4 second delay.
164
165
166 system name A system name is the name of any computer that uucp
167 can call; the uuname(1C) command prints a list of
168 these names.
169
170
171 LAN address The documentation for your LAN will show the form
172 of the LAN specific address.
173
174
175
176 If cu's default behavior is invoked (not using the -c or -l options),
177 cu will use the telno or systemname parameter to determine which medium
178 to use. If a telephone number is specified, cu will assume that you
179 wish to use a telephone line and it will select an automatic call unit
180 (ACU). Otherwise, cu will assume that it is a system name. cu will fol‐
181 low the uucp calling mechanism and use the /etc/uucp/Systems and
182 /etc/uucp/Devices files to obtain the best available connection. Since
183 cu will choose a speed that is appropriate for the medium that it
184 selects, you may not use the -s option when this parameter is a system
185 name.
186
187
188 The -c and -l options modify this default behavior. -c is most often
189 used to select a LAN by specifying a Type field from the
190 /etc/uucp/Devices file. You must include either a telno or systemname
191 value when using the -c option. If the connection to systemname fails,
192 a connection will be attempted using systemname as a LAN specific
193 address. The -l option is used to specify a device associated with a
194 direct connection. If the connection is truly a direct connection to
195 the remote machine, then there is no need to specify a systemname. This
196 is the only case where a telno or systemname parameter is unnecessary.
197 On the other hand, there may be cases in which the specified device
198 connects to a dialer, so it is valid to specify a telephone number. The
199 -c and -l options should not be specified on the same command line.
200
201 Conversation Phase
202 After making the connection, cu runs as two processes. The transmit
203 process reads data from the standard input and, except for lines begin‐
204 ning with ~, passes it to the remote system. The receive process
205 accepts data from the remote system and, except for lines beginning
206 with ~, passes it to the standard output. Normally, an automatic
207 DC3/DC1 protocol is used to control input from the remote so the buffer
208 is not overrun. Lines beginning with ~ have special meanings.
209
210 Commands
211 The transmit process interprets the following user initiated commands:
212
213 ~. Terminates the conversation.
214
215
216 ~! Escapes to an interactive shell on the local
217 system.
218
219
220 ~!cmd... Runs cmd on the local system (via sh -c).
221
222
223 ~$cmd... Runs cmd locally and send its output to the
224 remote system.
225
226
227 ~%cd Changes the directory on the local system.
228 Note: ~!cd will cause the command to be run
229 by a sub-shell, probably not what was
230 intended.
231
232
233 ~%take from [to] Copies file from (on the remote system) to
234 file to on the local system. If to is omit‐
235 ted, the from argument is used in both
236 places.
237
238
239 ~%put from [to] Copies file from (on local system) to file
240 to on remote system. If to is omitted, the
241 from argument is used in both places.
242
243
244 ~~line Sends the line ~ line to the remote system.
245
246
247 ~%break Transmits a BREAK to the remote system
248 (which can also be specified as ~%b).
249
250
251 ~%debug Toggles the -d debugging option on or off
252 (which can also be specified as ~%d).
253
254
255 ~t Prints the values of the termio structure
256 variables for the user's terminal (useful
257 for debugging).
258
259
260 ~l Prints the values of the termio structure
261 variables for the remote communication line
262 (useful for debugging).
263
264
265 ~%ifc Toggles between DC3/DC1 input control proto‐
266 col and no input control. This is useful
267 when the remote system does not respond
268 properly to the DC3 and DC1 characters (can
269 also be specified as ∼%nostop).
270
271
272 ~%ofc Toggles the output flow control setting.
273 When enabled, outgoing data may be flow con‐
274 trolled by the remote host (can also be
275 specified as ∼%noostop).
276
277
278 ~%divert Allows/disallows unsolicited diversions.
279 That is, diversions not specified by ~%take.
280
281
282 ~%old Allows/disallows old style syntax for
283 received diversions.
284
285
286 ~%nostop Same as ~%ifc.
287
288
289
290 The receive process normally copies data from the remote system to the
291 standard output of the local system. It may also direct the output to
292 local files.
293
294
295 The use of ~%put requires stty(1) and cat(1) on the remote side. It
296 also requires that the current erase and kill characters on the remote
297 system be identical to these current control characters on the local
298 system. Backslashes are inserted at appropriate places.
299
300
301 The use of ~%take requires the existence of echo(1) and cat(1) on the
302 remote system, and that the remote system must be using the Bourne
303 shell, sh. Also, tabs mode (see stty(1)) should be set on the remote
304 system if tabs are to be copied without expansion to spaces.
305
306
307 When cu is used on system X to connect to system Y and subsequently
308 used on system Y to connect to system Z, commands on system Y can be
309 executed by using ~~. Executing a tilde command reminds the user of the
310 local system uname. For example, uname can be executed on Z, X, and Y
311 as follows:
312
313 uname
314 Z
315 ~[X]!uname
316 X
317 ~~[Y]!uname
318 Y
319
320
321
322 In general, ~ causes the command to be executed on the original
323 machine. ~~ causes the command to be executed on the next machine in
324 the chain.
325
327 Example 1 Dialling a system
328
329
330 To dial a system whose telephone number is 9 1 201 555 1234 using
331 1200 baud (where dialtone is expected after the 9):
332
333
334 example% cu -s 1200 9=12015551234
335
336
337
338
339 If the speed is not specified, "Any" is the default value.
340
341
342 Example 2 Logging in to a system on a direct line
343
344
345 To login to a system connected by a direct line:
346
347
348 example% cu -l /dev/term/b
349
350
351
352
353 or
354
355
356 example% cu -l term/b
357
358
359
360 Example 3 Dialling a system with specific line and speed
361
362
363 To dial a system with a specific line and speed:
364
365
366 example% cu -s 1200 -l term/b
367
368
369
370 Example 4 Using a system name
371
372
373 To use a system name:
374
375
376 example% cu systemname
377
378
379
381 See environ(5) for descriptions of the following environment variables
382 that affect the execution of cu: LC_CTYPE, LC_MESSAGES, and NLSPATH.
383
385 The following exit values are returned:
386
387 0 Successful completion.
388
389
390 >0 An error occurred.
391
392
394 /etc/uucp/Devices device file
395
396
397 /etc/uucp/Sysfiles system file
398
399
400 /etc/uucp/Systems system file
401
402
403 /var/spool/locks/* lock file
404
405
407 See attributes(5) for descriptions of the following attributes:
408
409
410
411
412 ┌─────────────────────────────┬─────────────────────────────┐
413 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
414 ├─────────────────────────────┼─────────────────────────────┤
415 │Availability │SUNWbnuu │
416 └─────────────────────────────┴─────────────────────────────┘
417
419 cat(1), echo(1), stty(1), tip(1), uname(1), ct(1C), uuname(1C),
420 uucp(1C), remote(4), attributes(5), environ(5)
421
422
423 System Administration Guide: IP Services
424
426 The cu utility takes the default action upon receipt of signals, with
427 the exception of:
428
429 SIGHUP Close the connection and terminate.
430
431
432 SIGINT Forward to the remote system.
433
434
435 SIGQUIT Forward to the remote system.
436
437
438 SIGUSR1 Terminate the cu process without the normal connection clos‐
439 ing sequence.
440
441
442
443 The cu command does not do any integrity checking on data it transfers.
444 Data fields with special cu characters may not be transmitted properly.
445 Depending on the interconnection hardware, it may be necessary to use a
446 ~. to terminate the conversion, even if stty 0 has been used. Non-
447 printing characters are not dependably transmitted using either the
448 ~%put or ~%take commands. ~%put and ~%take cannot be used over multi‐
449 ple links. Files must be moved one link at a time.
450
451
452 There is an artificial slowing of transmission by cu during the ~%put
453 operation so that loss of data is unlikely. Files transferred using
454 ~%take or ~%put must contain a trailing newline, otherwise, the opera‐
455 tion will hang. Entering a Control-D command usually clears the hang
456 condition.
457
458
459
460SunOS 5.11 11 May 2001 cu(1C)