免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1640 | 回复: 2
打印 上一主题 下一主题

[SCO UNIX] how to use cu command [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-03-11 13:28 |只看该作者 |倒序浏览
how to use cu command

论坛徽章:
0
2 [报告]
发表于 2004-03-12 09:53 |只看该作者

how to use cu command

# man cu  :em11:
Reformatting page. Please wait... completed

cu(1)                                                                   cu(1)

NAME

  cu - Connects directly or indirectly to a remote system

SYNOPSIS

  cu [-dht] [-e  | -o] [-l line] [-s speed] -n  | telephone_number

  cu [-dhnt] [-e  | -o] system

  The cu command connects one system to a remote system.  If the remote sys-
  tem is running the proper software, cu provides additional capabilities,
  such as file transfer.

STANDARDS

  Interfaces documented on this reference page conform to industry standards
  as follows:

  cu:  XCU5.0

  Refer to the standards(5) reference page for more information about indus-
  try standards and associated tags.

OPTIONS

  -d  Prints diagnostic traces.

  -e  Designates that even parity is to be generated for data sent to the
      remote system.

  -h  Emulates local echo, supporting calls to other systems that expect ter-
      minals to be set to half-duplex mode.

  -l line
      Specifies a device name to use as the communications line.  This can be
      used to override the search that would otherwise take place for the
      first available line with the right speed.  When the -l option is used
      without the -s option, the speed of a line is taken from the
      /usr/lib/uucp/Devices file.

      When the -l and -s options are used together, cu searches the
      /usr/lib/uucp/Devices file to check whether the requested speed is
      available for the specified line.  If so, the connection is made at the
      requested speed; otherwise, an error message is printed, and the call
      is not made.

      The specified device is generally a hardwired asynchronous line (for
      example, /dev/tty2), in which case a telephone number
      (telephone_number) is not required.  If the specified device is associ-
      ated with a modem, a telephone number must be provided.  Using this
      option with system rather than with telephone_number does not give the
      desired result (see system, which follows).

      [Tru64 UNIX]  Under ordinary circumstances, you should not have to
      specify the transmission speed, or a line/device.  The default values
      should be sufficient.  (See your system administrator for more informa-
      tion.)

  -n  Prompts you to provide the telephone number to be dialed, rather than
      taking it from the command line (for added security).

  -o  Designates that odd parity is to be generated for data sent to the
      remote system.

  -s speed
      Specifies the transmission speed (300, 1200, 2400, 4800, or 9600 baud).
      The default value is Any speed, which instructs the system to use the
      rate appropriate for the default (or specified) transmission line.
      (The order of the transmission lines is specified in the
      /usr/lib/uucp/Devices file.)  Most modems operate at 300, 1200, or 2400
      baud, while most hardwired lines are set to 1200 baud or higher.  When
      transferring data such as a file between a local and a remote system, a
      speed of 300 baud may occasionally need to be specified.  The lower
      baud rate results in less interference on the line.

  -t  Used to dial a terminal that has been set to auto-answer.  Appropriate
      mapping of carriage-return to carriage-return/linefeed pairs is set.

OPERANDS

  telephone_number
      When using a modem, the argument is the telephone number, with
      appropriately placed equal signs for secondary dial tones, or dashes
      for delays of 4 seconds.

  system
      The name of the remote system with which a connection is established.
      A system name can be used rather than a telephone number; in that case,
      cu obtains an appropriate hardwired line or telephone number from
      /usr/lib/uucp/Systems.  System names must be ASCII characters only.

      [Tru64 UNIX]  Do not use the system operand in conjunction with the -l
      and -s options.  If you do, cu connects to the first available line for
      the requested system name, ignoring the specified line and speed.

DESCRIPTION

  The cu command can establish the connection over a hardwired line, or over
  a telephone line via a modem.  Once the connection is established, you can
  be logged in on both systems at the same time, executing commands on either
  one without dropping the communications link.  If the remote computer is
  also running the proper software (see Additional Information), you can
  transfer files between the two systems.

  [Tru64 UNIX]  The system should already be configured to use the cu com-
  mand.  (See your system administrator for more information.)

  [Tru64 UNIX]  After issuing cu from the local system, you must press
  <Return>; and then log in to the remote system.

  After making the connection, cu runs as two concurrent processes:  the
  transmit process reads data from standard input and, except for lines
  beginning with a ~ (tilde), passes that data to the remote terminal.  The
  receive process accepts data from the remote system and, except for lines
  beginning with a ~ (tilde), passes it to standard output.  To control input
  from the remote system so the buffer is not overrun, cu uses an automatic
  XON/XOFF protocol.

  In addition to issuing regular system commands on the remote system, you
  can also issue special cu local commands, which are preceded by a ~
  (tilde).  Use these ~ commands to issue system commands on the local system
  and to perform tasks such as transferring files between two systems.

  Local Tilde Commands

  The transmit process interprets lines beginning with a tilde in the follow-
  ing ways:

  ~.  Logs you off the remote computer and terminates the remote connection.
      Depending on the interconnection hardware, it may be necessary to use a
      ~. to terminate the conversation even if the normal log off sequence
      was used.

  ~!  Returns you to an interactive shell on the local system.  Toggle
      between the local and remote systems using ~! (remote to local) and
      End-of-File (local to remote).

  ~!command
      Executes the command denoted by command on the local system via sh -c.

  ~$command
      Runs the command denoted by command locally and sends its output to the
      remote system for execution.

  ~%cddirectory
      Changes the directory on the local system to directory.

  ~%take from [to]
      Transfers files only.  Copies the from file on the remote system to the
      to file on the local system.  If to is omitted, the remote file is
      copied to the local system under the same file name.  As each block of
      the file is transferred, consecutive single digits are displayed on the
      terminal screen.

  ~%put from [to]
      Transfers files only.  Copies the from file on the local system to the
      to file on the remote system.  If to is omitted, the local file is
      copied to the remote system under the same file name.  As each block of
      the file is transferred, consecutive single digits are displayed on the
      terminal screen.  There is an artificial slowing of transmission by the
      cu command during ~%put operations so that loss of data is unlikely.

  ~~line
      Sends the string denoted by ~line to the remote system.

  ~%break
      Transmits a BREAK signal to the remote system. The BREAK can also be
      specified as ~%b.

  ~%debug
      [Tru64 UNIX]  Toggles the -debug option on or off; this can also be
      specified as ~%d.

  ~t  [Tru64 UNIX]  Prints the values of the TERMIO structure variables for
      your terminal.  This is useful for debugging.

  ~l  [Tru64 UNIX]  Prints the values of the TERMIO structure variables for
      the remote communications line.  This is useful for debugging.

  ~%nostop
      Toggles between XON/XOFF input control protocol and no input control.
      This is useful in case the remote system is one that does not respond
      properly to the <Ctrl-s>; and <Ctrl-q>; characters.

  [Tru64 UNIX]  As soon as you enter ~!,~%, ~$, ~t, or ~l, the system
  displays the name of the local computer in the a format such as the follow-
  ing:

       ~[system]!/%

  You then enter the command to be executed on the local computer.

  Asynchronous Events

  The cu command takes the default action upon receipt of signals, with the
  exception of:

  SIGHUP
      Closes the connection and terminates.

  SIGINT
      Forwards the signal to the remote system.

  SIGQUIT
      Forwards the signal to the remote system.

  SIGUSR1
      Terminates the cu process without the normal connection closing
      sequence.

  Additional Information

    +  The receive process normally copies data from the remote system to the
       local system's standard output.  Internally, the program accomplishes
       this by initiating an output diversion to a file when a line from the
       remote system begins with ~>;.

       Data from the remote system is diverted to file on the local system.
       The trailing ~>; marks the end of the diversion.

    +  The use of ~%put requires stty and cat on the remote system.  It also
       requires that the current Erase and Kill characters on the remote sys-
       tem be identical to these current control characters on the local sys-
       tem.  Backslashes are inserted at appropriate places.

    +  The use of ~%take requires echo and cat on the remote system.  Also,
       stty tabs mode should be set on the remote system if tabs are to be
       copied without expansion to spaces.

    +  The cu command can be used to connect multiple systems, and commands
       can then be executed on any of the connected systems.  For example,
       issue cu on system X to connect to system Y, and then issue cu on sys-
       tem Y to connect to system Z.  System X is then the local computer,
       and systems Y and Z are remote computers.

       You can execute commands on system Z by logging in and issuing the
       command.  Commands can be executed on system X by prefixing the com-
       mand with a single tilde (~command), and on system Y by prefixing the
       command with two tildes (~~command).  In general, one tilde causes the
       specified command to be executed on the original local computer, and
       two tildes cause the command to be executed on the next system on
       which cu was issued.

       For example, once the multiple systems are connected, you can execute
       the uname command with the -n option (to display the node name) on Z,
       X, and Y as follows:
            $ uname -n
            Z

            $ ~!uname -n
            X

            $ ~~!uname -n
            Y

NOTES

  The cu utility is marked LEGACY in XCU Issue 5.

   1.  [Tru64 UNIX]  After executing cu, you must log in to the remote system
       and press <Return>;.

   2.  [Tru64 UNIX]  The cu command does not do integrity checking on data it
       transfers.

   3.  [Tru64 UNIX]  Data fields with special cu characters may not be
       transmitted properly.

   4.  [Tru64 UNIX]  Depending on the interconnection hardware, it may be
       necessary to use a ~. (tilde) to terminate the conversation, even if
       the normal logout sequence was used.

   5.  [Tru64 UNIX]  There is an artificial slowing of transmission by cu5
       during the ~%put operation so that loss of data is unlikely.

EXIT STATUS

  The following exit values are returned:

  0   Successful completion.

  >;0  An error occurred.

EXAMPLES

   1.  To connect to a remote system using a system name, enter:
            cu venus

       In this example, you are connected to the remote system venus, which
       is listed in the file /usr/lib/uucp/Systems.

   2.  To dial a remote system whose telephone number is 1-201-555-1212,
       where dialing 9 is required to get an outside dial tone and the baud
       rate is 1200, enter:
            cu -s 1200 9=12015551212

       If the speed is not specified, Any is the default value.

   3.  To log in to a system connected by a hardwired asynchronous line,
       enter:
            cu -l /dev/tty2

   4.  To dial a remote system with a specified line and a specific speed,
       enter:
            cu -s 1200  -l tty3

   5.  To dial a remote system using a specific line associated with a modem,
       enter:
            cu -l cul4  9=12015551212

   6.  To open a virtual terminal on the local system after logging in to the
       remote system, enter:
            ~!open sh

   7.  To display the contents of a file after logging in to the remote sys-
       tem, enter:
            ~!more /usr/msg/memos/file10

       The contents of file10 in the directory /usr/msg/memos on the local
       system are displayed.

   8.  To copy a file from the local system to the remote system (after log-
       ging in to the remote system) without changing the file name, enter:
            ~%put /u/judith/file

       The file /u/judith/file is copied from the local system to the remote
       system without changing the name of the file.

   9.  To copy a file from the local system to the remote system (after log-
       ging in to the remote system) and change the file name, enter:
            ~%put /u/judith/file /u/judith/tmpfile

       The file /u/judith/file is copied from the local to the remote system
       and renamed /u/judith/tmpfile.

   10. To copy a file from the remote system to the local system (after log-
       ging in to the remote system) without changing the name of the file,
       enter:
            ~%take /u/jeanne/test1

       The file /u/jeanne/test1 is copied from the remote to the local sys-
       tem.

   11. To copy a file from the remote system to the local system (after log-
       ging in to the remote system) and change the file name, enter:
            ~%take /u/jeanne/test1 /u/jeanne/tmptest

       The file /u/jeanne/test1 is copied from the remote to the local system
       and renamed /u/jeanne/tmptest.

ENVIRONMENT VARIABLES

  The following environment variables affect the execution of cu:

  LANG
      Provides a default value for the internationalization variables that
      are unset or null. If LANG is unset or null, the corresponding value
      from the default locale is used.  If any of the internationalization
      variables contain an invalid setting, the utility behaves as if none of
      the variables had been defined.

  LC_ALL
      If set to a non-empty string value, overrides the values of all the
      other internationalization variables.

  LC_CTYPE
      Determines the locale for the interpretation of sequences of bytes of
      text data as characters (for example, single-byte as opposed to multi-
      byte characters in arguments).

  LC_MESSAGES
      Determines the locale for the format and contents of diagnostic mes-
      sages written to standard error.

  NLSPATH
      Determines the location of message catalogues for the processing of
      LC_MESSAGES.

FILES

  /var/spool/locks/LCK..tty_number
      Prevents multiple use of device

  /usr/lib/uucp/Devices
      Information about available devices

  /usr/lib/uucp/Dialcodes
      Dialing code abbreviations

  /usr/lib/uucp/Dialers
      Initial handshaking on a link

  /usr/lib/uucp/Permissions
      Access permission codes

  /usr/lib/uucp/Systems
      Accessible remote systems

SEE ALSO

  Commands:  cat(1), ct(1), echo(1), rmail(1), stty(1), tip(1), uname(1),
  uucico(, uucleanup(, uucp(1), uuencode(1), uudecode(1), uulog(1),
  uuname(1), uupick(1), uusched(, uusend(1), uustat(1), uuto(1), uux(1)

  Standards:  standards(5)  

论坛徽章:
0
3 [报告]
发表于 2004-03-12 17:26 |只看该作者

how to use cu command

看帮助我也会,可是用本机串口2连接到另一台alpha机:cu -l /dev/tty01后没有什么反应,直接回到了命令行状态。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP