← 返回命令列表

Linux command

chat 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Example

chat '[expect_send_pairs]'

Example

chat -f '[path/to/chat_script]'

Example

chat -t [timeout_in_seconds] '[expect_send_pairs]'

Example

chat -v '[expect_send_pairs]'

Example

chat -r [path/to/report_file] '[expect_send_pairs]'

Dial

chat -T '[phone_number]' '"ATDT\\T CONNECT"'

Example

chat 'ABORT "[error_string]" [expect_send_pairs]'

说明

chat automates conversations with modems and serial devices by exchanging expect-send string pairs. It waits for an expected string from the device, then sends a response, repeating this process through a scripted sequence. The primary use case is establishing PPP (Point-to-Point Protocol) connections over serial lines and modems. A typical chat script initializes the modem with AT commands, dials a phone number, waits for a CONNECT response, and handles login sequences. Abort strings can be defined to terminate the script on error conditions like BUSY or NO CARRIER. chat is part of the ppp package and is typically invoked by pppd rather than run directly. Scripts can be specified inline on the command line or loaded from a file.

参数

-f _file_
Read script from file
-t _seconds_
Timeout for expecting responses
-v
Verbose logging to syslog
-r _file_
Log specific strings to report file
-T _string_
Substitute \T in script with string
-V
Log all conversation to stderr

FAQ

What is the chat command used for?

chat automates conversations with modems and serial devices by exchanging expect-send string pairs. It waits for an expected string from the device, then sends a response, repeating this process through a scripted sequence. The primary use case is establishing PPP (Point-to-Point Protocol) connections over serial lines and modems. A typical chat script initializes the modem with AT commands, dials a phone number, waits for a CONNECT response, and handles login sequences. Abort strings can be defined to terminate the script on error conditions like BUSY or NO CARRIER. chat is part of the ppp package and is typically invoked by pppd rather than run directly. Scripts can be specified inline on the command line or loaded from a file.

How do I run a basic chat example?

Run `chat '[expect_send_pairs]'` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f _file_ do in chat?

Read script from file