📄 cu.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>cu</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_001_014_282"> </a>NAME</h4><blockquote>cu - call another system (<b><a href="intro.html#tag_001_003_003">LEGACY</a></b>)</blockquote><h4><a name = "tag_001_014_283"> </a>SYNOPSIS</h4><blockquote><pre><code>cu -n<b>[</b>-dht<b>] [</b>-o | -e <b>][</b>-l <i>line</i><b>][</b>-s <i>speed</i><b>]</b>cu <b>[</b>-dht<b>] [</b>-o | -e <b>][</b>-l <i>line</i><b>][</b>-s <i>speed</i><b>] </b><i>telno</i>cu <b>[</b>-dht<b>] [</b>-o | -e <b>][</b>-s <i>speed</i><b>]</b> -l <i>line</i>cu <b>[</b>-dht<b>] [</b>-o | -e <b>] </b><i>systemname</i></code></pre></blockquote><h4><a name = "tag_001_014_284"> </a>DESCRIPTION</h4><blockquote>The<i>cu</i>utilitycalls up another system.It manages an interactive conversation, with possibletransfers of text files.<p>On systems where there are no available communications means(either temporarily or permanently), thisutility will write an error message describing the problemand exit with a non-zero exit status.</blockquote><h4><a name = "tag_001_014_285"> </a>OPTIONS</h4><blockquote>The<i>cu</i>utility supports the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b> </a> .The following options are supported:<dl compact><dt><b>-s </b><i>speed</i><dd>Specify the transmission speed.The default value is device-specific.<dt><b>-l </b><i>line</i><dd>Specify a device name to use as the communication line.This can beused to override the search that would otherwise take placefor the first available line having the rightspeed.When the<b>-l</b>option is used without the<b>-s</b>option, the speed of a line is taken from the devices file.When the<b>-l</b>and<b>-s</b>options are both used together,<i>cu</i>will search the devices file to check if the requested speed for therequested line is available.If so, the connection will be made at the requested speed;otherwise, an error message will be written and the callwill not be made.If the specified deviceis associated with an autodialler,a telephone number must be provided.<dt><b>-h</b><dd>Emulate local echo, supporting calls to other computer systemsthat expect terminals to be set to half-duplex mode.<dt><b>-t</b><dd>Dial a remote modem that has been set to auto-answer.Appropriate mapping of carriage-returnto carriage-return-line-feedpairs is set.<dt><b>-d</b><dd>Write diagnostic traces.<dt><b>-o</b><dd>Designate that odd parity is to be generatedfor data sent to the remote system.<dt><b>-e</b><dd>Designate that even parity is to be generated for data sent to theremote system.<dt><b>-n</b><dd>Prompt the user toprovide the telephone number to be dialled rather thantaking it from the command line.This is for added security.</dl></blockquote><h4><a name = "tag_001_014_286"> </a>OPERANDS</h4><blockquote>The following operands are supported:<dl compact><dt><i>telno</i><dd>When using an automatic dialler, specifiesthe telephone number with equal signs for secondary dial tone or minussigns placed appropriately for delays of 4 seconds.<dt><i>systemname</i><dd>Specifies a<i><a href="uucp.html">uucp</a></i>system name, which can be used rather than a telephone number;in this case,<i>cu</i>will obtain an appropriate direct line ortelephone number from a system file.</dl><br></blockquote><h4><a name = "tag_001_014_287"> </a>STDIN</h4><blockquote>The standard input is used to accept data to write to the remote system;see the EXTENDED DESCRIPTION section.</blockquote><h4><a name = "tag_001_014_288"> </a>INPUT FILES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_289"> </a>ENVIRONMENT VARIABLES</h4><blockquote>The following environment variables affect the execution of<i>cu</i>:<dl compact><dt><i>LANG</i><dd>Provide a default value for the internationalisation variablesthat are unset or null.If<i>LANG</i>is unset or null, the corresponding value from theimplementation-dependent default locale will be used.If any of the internationalisation variables contains an invalid setting, theutility will behave as if none of the variables had been defined.<dt><i>LC_ALL</i><dd>If set to a non-empty string value,override the values of all the other internationalisation variables.<dt><i>LC_CTYPE</i><dd>Determine thelocale for the interpretation of sequences of bytes of text data ascharacters (for example, single- as opposed to multi-byte charactersin arguments and input data).<dt><i>LC_MESSAGES</i><dd>Determine the locale that should be used to affectthe format and contents of diagnosticmessages written to standard error.<dt><i>NLSPATH</i><dd>Determine the location of message cataloguesfor the processing of<i>LC_MESSAGES .</i></dl></blockquote><h4><a name = "tag_001_014_290"> </a>ASYNCHRONOUS EVENTS</h4><blockquote>The<i>cu</i>utility takes the default action upon receipt of signals,with the exception of:<dl compact><dt>SIGHUP<dd>Close the connection and terminate.<dt>SIGINT<dd>Forward to the remote system.<dt>SIGQUIT<dd>Forward to the remote system.<dt>SIGUSR1<dd>Terminate the<i>cu</i>process without the normal connection closing sequence.</dl></blockquote><h4><a name = "tag_001_014_291"> </a>STDOUT</h4><blockquote>The standard output is used to display data to read from the remote system;see the EXTENDED DESCRIPTION section.</blockquote><h4><a name = "tag_001_014_292"> </a>STDERR</h4><blockquote>Used only for diagnostic messages.</blockquote><h4><a name = "tag_001_014_293"> </a>OUTPUT FILES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_294"> </a>EXTENDED DESCRIPTION</h4><blockquote>After making the connection,<i>cu</i>runs as two processes: the<i>transmit</i>process reads data from the standard input and,except for lines beginning with "~",passes it to the remote system; the<i>receive</i>process accepts data from the remote system and,except for lines beginning with "~", passes it to the standard output.Normally, an automatic DC3/DC1protocol is used to control input from the remote system so thatthe buffer is not overrun.Lines beginning with "~" have special meanings.<p>The<i>transmit</i>process interprets the following user-initiated commands as:<dl compact><dt><b>~.</b><dd>Terminate the conversation.<dt><b>~!</b><dd>Escape to an interactive command interpreteron the local system.<dt><b>~!</b><i>command</i><dd>Execute the shell<i>command</i>on the local system.<dt><b>~$</b><i>command</i><dd>Run the shell<i>command</i>locally and send its outputto the remote system for execution.<dt><b>~%cd</b><dd>Change the directory on the local system.<dt><b>~%take</b> <i>from</i> <b>[</b><i>to</i><b>]</b><dd>Copy file<i>from</i>(on the remote system) to file<i>to</i>on the local system.If<i>to</i>is omitted, the<i>from</i>argument is used in both places.<dt><b>~%put</b> <i>from</i> <b>[</b><i>to</i><b>]</b><dd>Copy file<i>from</i>(on local system) to file<i>to</i>on remote system.If<i>to</i>is omitted, the<i>from</i>argument is used in both places.<dt><b>~~</b><i>line</i><dd>Send the linelineto the remote system.<dt><b>~%break </b>or<b> ~%b</b><dd>Transmit aBREAKto the remote system.<dt><b>~%nostop</b><dd>Toggle between DC3/DC1input control protocol and no input control.This is useful in case the remote system is one that doesnot respond properly to theDC3andDC1characters.</dl><p>The<i>receive</i>process normally copies data from the remote system to its standardoutput.<p>The use of<b>~%put</b>requires<i><a href="stty.html">stty</a></i>and<i><a href="cat.html">cat</a></i>on the remote side.It also requires that thecurrenteraseandkillcharacters on the remotesystem be identical to these current control characters on the local system.Backslashes are inserted at appropriate places.<p>The use of<b>~%take</b>requires the existence of<i><a href="echo.html">echo</a></i>and<i><a href="cat.html">cat</a></i>on the remote system.Also, tabsmode (see<i><a href="stty.html">stty</a></i>)should be set on the remote system iftabs are to be copied without expansion to spaces.<p>When<i>cu</i>is used on system<i>X</i>to connect to system<i>Y</i>and subsequently used on system<i>Y</i>to connect to system<i>Z</i>,commands on system<i>Y</i>can be executed by using "~~".For example,<i>uname</i>can be executed on<i>Z</i>,<i>X</i>and<i>Y</i>as follows:<pre><code><b>$</b> uname<b>Z</b><b>$</b>~<b>[X]</b>!uname<b>X</b><b>$</b>~~<b>[Y]</b>!uname<b>Y</b></code></pre><p>(The darker type indicates system-generated text.The bracketed system names are written by the systemafter it has recognised the!pair, but before it echoed the "!".)In general, "~"causes the command to be executed on the original machine; "~~"causes the command to be executed on the next machine in the chain.<br></blockquote><h4><a name = "tag_001_014_295"> </a>EXIT STATUS</h4><blockquote>The following exit values are returned:<dl compact><dt>0<dd>Successful completion.<dt>>1<dd>An error occurred.</dl></blockquote><h4><a name = "tag_001_014_296"> </a>CONSEQUENCES OF ERRORS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_297"> </a>APPLICATION USAGE</h4><blockquote>Typical implementations of this utility require a communicationsline configured to use the <b>XBD</b> specification, <a href="../xbd/termios.html"><b>General Terminal Interface</b> </a> ,but other communications means may be used.<br></blockquote><h4><a name = "tag_001_014_298"> </a>EXAMPLES</h4><blockquote><ol><p><li>To dial a system whose telephone number is 912015551212using a device-specific speed(where dial tone is expected after the 9):<pre><code>cu 9=12015551212</code></pre><p><li>To login to a system connected by a direct line:<pre><code>cu -l /dev/ttyXX</code></pre><p>or:<pre><code>cu -l ttyXX</code></pre><p><li>To dial a system with the specific line and a specific speed:<pre><code>cu -s 1200 -l ttyXX</code></pre><p><li>To dial a system using a specific line associated with an autodialler:<pre><code>cu -l culXX 9=12015551212</code></pre><p><li>To use a system name:<pre><code>cu systemname</code></pre><p></ol></blockquote><h4><a name = "tag_001_014_299"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_300"> </a>SEE ALSO</h4><blockquote><i><a href="cat.html">cat</a></i>,<i><a href="echo.html">echo</a></i>,<i><a href="stty.html">stty</a></i>,<i><a href="uname.html">uname</a></i>,<i><a href="uucp.html">uucp</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -