linux chat脚本语法,chat__linux命令中文解释.html

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值