Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   chat    ( 8 )

автоматизированный разговорный скрипт с модемом (Automated conversational script with a modem)

TERMINATION CODES

The chat program will terminate with the following completion
       codes.

0 The normal termination of the program. This indicates that the script was executed without error to the normal conclusion.

1 One or more of the parameters are invalid or an expect string was too large for the internal buffers. This indicates that the program as not properly executed.

2 An error occurred during the execution of the program. This may be due to a read or write operation failing for some reason or chat receiving a signal such as SIGINT.

3 A timeout event occurred when there was an expect string without having a "-subsend" string. This may mean that you did not program the script correctly for the condition or that some unexpected event has occurred and the expected string could not be found.

4 The first string marked as an ABORT condition occurred.

5 The second string marked as an ABORT condition occurred.

6 The third string marked as an ABORT condition occurred.

7 The fourth string marked as an ABORT condition occurred.

... The other termination codes are also strings marked as an ABORT condition.

Using the termination code, it is possible to determine which event terminated the script. It is possible to decide if the string "BUSY" was received from the modem as opposed to "NO DIAL TONE". While the first event may be retried, the second will probably have little chance of succeeding during a retry.