COHERENT manpages
This page displays the COHERENT manpage for cu [UNIX-compatible communications utility].
List of available manpages
Index
cu -- Command UNIX-compatible communications utility cu [options] [system] [phone] [dir] The command cu implements a version of the communications utility used under UNIX System V. (Its name is an acronym for ``call UNIX''.) With it, you can interactively telephone other systems, upload files, download files, and perform other communications tasks. Unlike the program ckermit, which is also included with COHERENT, cu uses the information stored in UUCP data-base files dial, port, and sys to automate the dialing of a remote system. To tell cu to dial a given system, just use that system's name on the cu command line. cu then reads from files dial, port, and sys the information on how to dial the system you have named; then uses that information to open the port, set up the modem, and dial the system, up to the point where you see a login prompt on the remote system. For example, to dial system mwcbbs, use the command: cu mwcbbs Instead of dialing a remote system, you may wish to talk directly to a modem -- for example, to reset its registers; or you may wish to log into a local system that is directly connected to your system via a serial port. To talk directly to a device, use the option -p followed by the name of the port into which the device is plugged, plus the command dir. This command tells cu that you wish to talk to the port directly. (Ports are named in the file port; for details, see its entry in the Lexicon.) For example, to talk directly a modem that is on a port named MWCBBS, use the command: cu -p MWCBBS dir To have cu dial a specific telephone number over a specific port, again use the option -p option to name the port, followed by the telephone number to call. For example, the command cu -p MWCBBS 17085590412 connects to the modem on port MWCBBS and dial the telephone number 1-708- 559-0412. cu assumes that a string that begins with an alphabetic character names a system. To call a system whose name begins with numeral, use the command- line option -z, described below. cu Commands You can give commands to cu while you converse with the remote system. Each command begins with an escape character, which by default is the tilde `~'. cu recognizes the escape character only when it appears at the beginning of a line. After you type the escape character, cu replies with the name of your system, to show that it is ready to receive your command. If you do not see cu's reply within a second or two, something has gone wrong. To send to the remote system an escape character at the beginning of a line, enter it twice; for example, typing ~~ sends a single `~' to the remote system. All commands are either a single character or a word that begins with `%'. cu recognizes the following commands: ~. Terminate the conversation. ~! command Run command in a shell on your local system. If no command is given, start up a shell. ~$ command Run command on your local system, and redirect to the remote system what command writes to the standard output. ~| command Run command on your local system, and pipe into command what the remote system sends to your system. ~+ command Combine the commands ~$ and ~|. You can use this command to invoke alternative file-transfer utilities, e.g., rz and sz. ~# ~%break Send a break signal. ~c directory ~%cd directory cd to directory on your local system. ~> file Send file to the remote system. This command just dumps the file over the communication line, and performs no error checking. It assumes that the remote system is expecting it. You should first open a file on the remote system such as through the command cat > filename before you invoke this feature of cu. ~< Receive a file from the remote system. cu prompts you to name the file into which it will write what it receives from the remote system, then prompts you for the command to execute on the remote system to begin the file transfer (often, just cat filename). cu reads data from the remote system and writes them into into the file you named on your system until it detects the variable eofread. ~p herefile farfile ~%put herefile farfile Copy (or put) file herefile on your system into file farfile on the remote system. ~t farfile herefile ~%take farfile herefile Take file farfile from the remote system, and write it into file herefile on your system. This runs the appropriate commands on the remote system. ~s variable [value] Set the cu variable to value. If no value is not given, set variable to true. cu's variables are described below. ~! variable Set the cu variable to false. cu's variables are described below. ~%nostop Turn off XON/XOFF flow control. ~%stop Turn on XON/XOFF flow control. ~v List all cu variables and their values. cu's variables are described below. ~? Help: list all cu commands. cu Variables The following variables are build into cu to control its default behaviors: binary This variable indicates whether to pass binary information untouched when it transfers a file. If this variable is false, cu converts newline characters to carriage returns. If set to true, then cu passes binary data through untouched. The default is false. binary-prefix This variable gives the string that prefaces a binary character in a file transfer. This variable applies only if the variable binary variable is true. The default is <ctrl-Z>. delay If this variable is true, cu delays for one second after it recognizes the escape character. The default is true. echo-check If true, cu checks file transfers by examining what the remote system echoes. This is not a robust method of checking the integrity of a transferred file, but it is the best that cu offers. The default is false. echonl The character that cu looks for after it sends each line in a file. The default is the carriage return. eofread This sets the string that cu looks for after it receives a file retrieved with the command ~<. The default is $, which is intended to be a typical shell prompt. eofwrite The string that cu writes after it sends a file with the command ~>. The default is <ctrl-D>. eol This variable gives the characters that cu recognizes as completing a line of input. cu recognizes the escape character only when it occurs immediately after one of the eol characters. cu recognizes the following eol characters by default: <ctrl-C>, <ctrl- D>, <ctrl-O>, <ctrl-Q>, <ctrl-R>, <ctrl- S>, and <ctrl-U>. escape The escape character. By default, this is the tilde `~'. kill This tells cu the character to use to delete a line if the echo- check fails. The default is <ctrl-U>. resend The number of times to resend a line if the echo-check continues to fail. The default is ten. timeout This variable sets the time, in seconds, that cu waits for a character either when it does echo-checking or when it looks for the echonl character. The default is 30. verbose Print accumulated information during a file transfer. The default is true. To list the values of the variables, use the command ~v. To modify a variable, use the commands ~s or ~!. For example, to turn off the one- second pause after sending an escape character, use the command: ~! delay To change the escape character from `~' to `\', use the command: ~s escape \ Options cu recognizes the following command-line options: -a port The same as the option -p, described below. -c number Dial number. You must use this option if the telephone number begins with a letter. -d Enter debugging mode. This is equivalent to -x all. -e Use even parity. -N Equivalent to the command -s N, where N is an integer. -h Half-duplex mode: echo locally all characters sent to the remote system. -I file Use file instead of the configuration file. -l device The device on which to dial out. Use this option to dial out on ports that are not list in the file port. You must have write permission on device. -n Prompt for the telephone number to use. -o Use odd parity. If you use both -e and -o on the command line, no parity is used. If neither is specified, cu uses the default parity of the line. -p port The port to use. If you do not use this option, cu uses the default port for the system being contacted, as set in file /usr/lib/uucp/sys. -s speed Set the baud rate to speed. -t Map every carriage return character to the pair carriage/linefeed. Use this option when transferring files to an MS-DOS system. -z system Call system. You must use this option if the name of the remote system begins with a numeral. -x activity Log a given activity. These logs can help you debug problems with cu. cu recognizes the following activities: abnormal chat handshake port config incoming outgoing One -x option can name multiple activities, with the activities separated by commas. A cu command line can contain multiple -x options. You can also use this option with a number, which turns on that many activities from the foregoing list, in the order in which the appear in this list. For example, the option -x 2 is equivalent to the option -x abnormal,chat The option -x all logs on all activities. See Also ckermit, commands, dial, port, sys, UUCP Notes Unlike ckermit, the file-transfer facility in cu is primitive and performs no error checking. If you wish primarily to transfer files, you should consider using ckermit instead of cu. As noted above, the command ~+ plugs the standard input and standard output of two commands into each other; with this feature, you can use the other file-transfer utilities (e.g., rz and sz) to transfer files under cu. cu requires that the device /dev/console appear last in file /etc/ttys. If this is not so, cu refuses to disable the enabled port or dial out. For details on this file, see the Lexicon entry for ttys. cu was ported to COHERENT from the Taylor UUCP package, written by Ian Taylor (ian@airs.com).