⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 doc.out

📁 通讯程序源码
💻 OUT
📖 第 1 页 / 共 5 页
字号:
	  Page 30              Pcomm Reference Manual			       Pcomm Reference Manual               Page 31	  7.  DIALING WINDOW	  While Pcomm is dialing another system, a screen  similar  to  the	  following is shown:	+--------------------------------------------------------------------+	|                  D I A L I N G      W I N D O W                    |	+--------------------------------------------------------------------+	|                                                                    |	|                      System name: C Board                          |	|                      Pass number: 1                                |	|             Elapse time this try: 4                                |	|            Time at start of dial: 14:53:36                         |	|        Time at start of this try: 14:53:36                         |	|               Connect delay time: 35                               |	|                Redial delay time: 5                                |	|                        Auxiliary:                                  |	|               Result of last try:                                  |	|                                                                    |	| <SPACE>: Recycle    <DEL>: Remove from queue    E: Change delays   |	|                                                                    |	+---------------------- Press <ESC> to abort ------------------------+	  Items in the window are continuously updated to show the progress	  of the dialing attempt.	  The options available during the dialing window are:	       SPACE) Press the space  bar  to  stop  the  dialing  of  the	       current  entry and go on to the next entry in the queue.  If	       there is only  one  entry  in  the  queue,  that  number  is	       redialed.	       DEL) Press the DEL key to remove the current number from the	       queue.	       E) Press the letter "E" to change the connect delay time, or	       the  redial delay time (the pause between dialing attempts).	       You will be prompted to save the changes to disk.	  Page 32              Pcomm Reference Manual		    +-- Change Delay Times ---------------------+		    |                                           |		    |   Current connect delay time: 35          |		    |   Current redial delay time: 5            |		    |                                           |		    |   New connect delay: _                    |		    |   New redial delay:                       |		    |                                           |		    +-------------------------------------------+	       NOTE:  While the DEL and E options are being processed,  the	       dialing is temporarily suspended.			       Pcomm Reference Manual               Page 33	  8.  SCRIPT COMMANDS	  Pcomm doesn't have a built-in script language,  instead  it  uses	  Unix  shell  scripts  (Bourne shell, C shell, Korn shell, etc) to	  perform the necessary "chat" sequences to log  a  user  on  to  a	  remote system.	  Since shell scripts are run "outside" of Pcomm,  the  "pcomm_cmd"	  program  is  used  to  transmit  command sequences to Pcomm.  For	  example, a script can contain a line such as "pcomm_cmd  data_log	  on"  to  turn  on  the  data  logging feature.	  Shell scripts specified in the dialing directory  are  run  after	  the  connection  to the remote system, while scripts specified on	  the command  line  (with  the  -a  option)  are  run  before  the	  connection  is made.  You can make a shell script work under both	  situations by using the "pcomm_cmd is  connected"  command.   See	  the third example in section 8.4.	  You may hit the <ESC> key at any  time  to  abort  an  auto-login	  script before it has completed.	  WARNING:  Any file that has a "clear text" (un-encrypted) version	  of  your  password  is a significant security threat.  You should	  remove the read permission to all others.	  In order to assist in the creation  of  auto-login  scripts,  the	  following external programs have been provided.	  8.1.  Pcomm_cmd command	  Pcomm_cmd is an external Pcomm support program.  It is used  from	  inside shell scripts to access Pcomm commands, such as "pcomm_cmd	  send xmodem junk" for sending the file "junk" to the remote using	  the xmodem file transfer protocol.	  The following command line options are supported.	       SET BAUD [ 300 | 1200 | 2400 | 4800 | 9600 | 19200 | 38400 ]		    Set the baud rate for  the  current  connection.   This		    feature  is for use with the DIAL MANUAL command, since		    the baud rate  information  in  the  dialing  directory		    entries overrides this value.	       SET PARITY [ EVEN | ODD | NONE ]		    Set the parity for the  current  connection.   For  use		    with the DIAL MANUAL command.	       SET DATA_BITS [ 7 | 8 ]		    The number of data bits  (word  length)  used  for  the		    current  connection.   For  use  with  the  DIAL MANUAL		    command.	  Page 34              Pcomm Reference Manual	       SET STOP_BITS [ 1 | 2 ]		    The number of stop bits  for  the  current  connection.		    For use with the DIAL MANUAL command.	       SET DUPLEX [ HALF | FULL ]		    Set the duplex mode (local echo).  The HALF  option  is		    used  if  the remote system does not echo characters as		    they are typed.	       SET AUX filename		    Use the argument as the auxiliary file associated  with		    the  current  connection.  Since chaining of scripts is		    not supported, this feature would only be used  to  set		    the TTY or modem.	       SET HOT_KEY [1-256]		    Change the decimal value  of  the  "hot  key"  to  this		    value.	       SET ASCII_HOT string		    Change the ASCII representation of the hot key  to  the		    given  argument.   The  length of the string must be no		    more than 4 characters wide.	       SET FLOW_CTRL [ XON/XOFF | NONE ]		    Set the flow  control  between  the  local  and  remote		    systems to either XON/XOFF or NONE.	       SET CR_IN [ CR | CR/LF ]		    Translate in-comming carriage returns  carriage  return		    followed  by  a  line feed, or pass the carriage return		    through unchanged.	       SET CR_OUT [ CR | CR/LF ]		    Translate out-going carriage returns to CR or CR/LF.	       SET LOGFILE filename		    Change the name of the default log file.  For use  with		    the DATA_LOG command.	       SET DUMPFILE filename		    Change the name of the screen dump file.  For use  with		    the SCREEN_DUMP command.	       SET STRIP [ YES | NO ]		    Should the in-comming data be stripped to 7 bits?	       SET LOCAL_ECHO [ YES | NO ]		    Should  data  be  shown  on  the  screen  during  ASCII		    uploads?			       Pcomm Reference Manual               Page 35	       SET EXPAND [ YES | NO ]		    Should blank lines be  "expanded"  to  a  line  with  a		    single space?  For use only during ASCII uploads.	       SET CR_DELAY [ 0 | 100 | 150 ]		    Set the  delay  for  the  carriage  returns  for  ASCII		    uploads.	       SET PACE [ YES | NO ]		    Should the entire upload be artificially  slowed  down?		    For use during ASCII uploads.	       SET CR_UP [ NONE | ADD_LF | STRIP ]		    Controls the translation  of  carriage  returns  during		    ASCII uploads.	       SET LF_UP [ NONE | ADD_CR | STRIP ]		    Controls the translation of  line  feeds  during  ASCII		    uploads.	       SET TIMER [5-150]		    Controls the timer (in seconds) that detects the end of		    an ASCII download.	       SET CR_DN [ NONE | ADD_LF | STRIP ]		    Controls the translation  of  carriage  returns  during		    ASCII downloads.	       SET LF_DN [ NONE | ADD_CR | STRIP ]		    Controls the translation of  line  feeds  during  ASCII		    downloads.	       QUERY TTY_NAME		    Returns the name of the current TTY in use or NONE.	       QUERY MODEM_NAME		    Returns the name of the current modem in use or NONE.	       IF CONNECTED		    Returns a 1  if  Pcomm  is  currently  connected  to  a		    remote, otherwise a 0.	       IF LOG_STATUS		    Returns a 1 if the data logging feature is  turned  on,		    otherwise 0.	       IF PRINTER_STATUS		    Returns a 1 if the printer is turned on, otherwise 0.	  Page 36              Pcomm Reference Manual	       DIAL [ MANUAL phone_number ] entry_number		    Dial an entry from the dialing directory.   The  MANUAL		    option  is  used  to  optionally  dial  a  phone number		    without the use of the dialing directory.  DIAL returns		    after 1 attempt.  A return code of 1 means a connection		    was made.	       REDIAL entry_number		    Similar to the DIAL command, but 10 attempts are made.	       EXIT		    Hang up the phone and exit from Pcomm.	       CLEAR_SCREEN		    Clear the screen.	       CHG_DIR directory		    Change the  current  working  directory  to  the  given		    directory.	       HANG_UP		    Hang up the phone, but remain in Pcomm.	       PRINTER [ ON | OFF ]		    Control the logging of data to the printer.	       MODEM_BREAK		    Send a modem break  to  the  remote  system.   This  is		    typically  used  to  tell  the  remote  to  switch to a		    different baud rate.	       SEND protocol filename		    Send a file to the remote.   The  valid  protocols  are		    XMODEM,  XMODEM_1K,  MODEM7,  YMODEM,  YMODEM_G, ASCII,		    EXT_1, EXT_2, and EXT_3.	       RECEIVE protocol filename		    Receive a file from the remote.   The  valid  protocols		    are XMODEM, XMODEM_1K, MODEM7, YMODEM, YMODEM_G, ASCII,		    EXT_1, EXT_2, and EXT_3.	       SCREEN_DUMP		    Dump  the  current  contents  of  the  screen  to   the		    DUMPFILE.  If the file already exists, the new contents		    are appended to the file.	       DATA_LOG [ ON | OFF ]		    Control logging of the terminal session to the LOGFILE.		    If  the  file  already  exists,  the  new  contents are		    appended to the file.			       Pcomm Reference Manual               Page 37	  8.2.  Waitfor command	  The waitfor command has the following syntax:	       waitfor -n string	  where "n" is the number of seconds to wait and  "string"  is  the	  string to wait for.	  Waitfor returns a 0 if the string was found, a  1  if  it  didn't	  find  the  string within the allotted time, and a -1 if there was	  an error.  Waitfor returns immediately if the string is found.	  The waitfor command would  typically  be  used  in  a  script  to	  indicate that the desired prompt has appeared.  For example:	       waitfor -5 "ogin:"	       if [ "$?" -eq 0 ]	       then		    echo "egray"	       fi	  would wait up to 5 seconds for the string "ogin:".  If the return	  code  is  0 (the strings did appear), send the string "egray" (my	  user ID).	  NOTE:  Upper and lower case letters are considered different.  If	  you are not sure if the prompt is "Login:" or "login:", then skip	  the first letter in the string and use "ogin:".	  8.3.  Matches command	  The matches command has the following syntax:	       matches string1 string2	  Matches returns a 0 if  string2  is  contained  in  string1,  and	  returns  a 1 if it does not.  Unlike waitfor, the matches command	  does not read the TTY port.	  The matches command could be used to test string values such as:	       read junk	       matches $junk "login failed"	       if [ "$?" -eq 0 ]	       then		    exit	       fi	  Page 38              Pcomm Reference Manual	  8.4.  Examples	  It is not my intention to teach the reader  the  fundamentals  of	  Unix  shell  programming.   There  are  several good books on the	  subject available in stores.	  Remember to add execute permission to the 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -