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

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



   chat    ( 8 )

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

SAY STRINGS

The SAY directive allows the script to send strings to the user
       at the terminal via standard error.  If chat is being run by
       pppd, and pppd is running as a daemon (detached from its
       controlling terminal), standard error will normally be redirected
       to the file /etc/ppp/connect-errors.

SAY strings must be enclosed in single or double quotes. If carriage return and line feed are needed in the string to be output, you must explicitly add them to your string.

The SAY strings could be used to give progress messages in sections of the script where you want to have 'ECHO OFF' but still let the user know what is happening. An example is:

ABORT BUSY ECHO OFF SAY "Dialling your ISP...\n" '' ATDT5551212 TIMEOUT 120 SAY "Waiting up to 2 minutes for connection ... " CONNECT '' SAY "Connected, now logging in ...\n" ogin: account ssword: pass $ \c SAY "Logged in OK ...\n" etc ...

This sequence will only present the SAY strings to the user and all the details of the script will remain hidden. For example, if the above script works, the user will see:

Dialling your ISP... Waiting up to 2 minutes for connection ... Connected, now logging in ... Logged in OK ...