赞
踩
SENDING DATA FROM A FILE SENDING DATA FROM A FILE
If the string to send starts with an at sign (@), the rest of the string is taken to be the name of a file to read to get the string to send. If the last character of the data read is a newline, it is removed. The file can be a named pipe (or fifo) instead of a regular file. This
provides a way for chat
chat chat to communicate with another program, for example, a program to prompt the user and receive a password typed in.
放弃字符串 ABORT STRINGS ABORT STRINGS ABORT STRINGS
多以字串回呼叫的。 些字串可能是 CONNECTED 或是 NO CARRIER 或是 BUSY 。 通常要是到端失的希望束指令稿。 困是指令稿不地知道它可能接收到哪字串。在某次, 他可能接收到 BUSY 然而下次它可能接收到 NO CARRIER 。
些失字串可以用 ABORT 程序指定到指令稿中。像是下面例子般地到指令稿:
ABORT BUSY ABORT 'NO CARRIER' '' ATZ OK ATDT5551212 CONNECT
程序不期待什;而且接著送出 ATZ 字串。此期待的回是 OK 字串。它接收到 OK ,字串 ADTD5551212 就行。期待字串是 CONNECT 。 如果字串 CONNECT 被接收到那就行指令稿其的部份。然而,要是忙, 他送出 BUSY 字串。 使得字串符合失字元程序(abort char- acter)。 指令稿因它一失字串(abort string)而失(fail)。如果他接收到的是 NO CARRIER 字串, 它也因同的原因而失。不是可以接收到字串就是字串 chat 指令稿。
CLR_ABORT STRINGS CLR_ABORT STRINGS
This sequence allows for clearing previously set ABORT ABORT ABORT strings. ABORT ABORT ABORT strings are kept in an array of a pre-determined size (at compilation time); CLR_ABORT CLR_ABORT CLR_ABORT will reclaim the space for cleared entries so that new strings can use that space.
SAY STRINGS SAY STRINGS
The SAY
SAY SAY directive allows the script to send strings to the user at the terminal via standard error. If chat chat 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 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 explicitely 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 ... ogin: account ssword: pass
$ SAY "Logged in OK ... etc ...
This sequence will only present the SAY strings to the user and all the details of the script
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。