Sponsored Content
Operating Systems Linux How do I capture responses from the chat command? Post 302494389 by Bashingaway on Monday 7th of February 2011 06:26:54 AM
Old 02-07-2011
How do I capture responses from the chat command?

Unfortunately googling the word 'chat' gives you zebedee billion responses that relate to everything and few of them refer to the linux chat command. I've read the man page and found a couple of examples but can't see how to do this.

I want to query the modem for it's manufacturer, product id and firmware version using AT commands. I can get the modem to respond as expected to the commands if initiated using chat, however I can't see how to get the response into a bash variable for me to work on it.

for example

Code:
chat -V -s '' 'AT+CGMI' 'OK' '' > $COMPORT < $COMPORT

gives me the onscreen response I am looking for, however using a RESPONSEVALUE=`chat....` just gives me an empty variable.

Any ideas anyone?
 

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

talk command to chat

Hi, Could you please advice on the following query: There are 2 users on a unix box: 1. aaaa 2. bbbb I open 2 putty sessions and login with the above 2 users. Then I type the following using the aaaa user to chat with bbbb. talk bbbb or talk bbbb@hostname Result: the screen goes... (1 Reply)
Discussion started by: miltonkeynesguy
1 Replies

2. UNIX for Dummies Questions & Answers

talk command to chat

Hi, Could you please advice on the following query: There are 2 users on a unix box: 1. aaaa 2. bbbb I open 2 putty sessions and login with the above 2 users. Then I type the following using the aaaa user to chat with bbbb. talk bbbb or talk bbbb@hostname Result: the screen goes... (4 Replies)
Discussion started by: miltonkeynesguy
4 Replies

3. UNIX for Dummies Questions & Answers

Doing a capture while another command is executing?

Basically what i'm trying to do is execute an update command and at the same time have the system do a TCPdump to file for that update traffic. So I would like to connect the two commands so that the tcpdump terminates automatically when the update finishes/fails/whatever. Right now I have... (0 Replies)
Discussion started by: MrEddy
0 Replies

4. Web Development

Can you embed Skype or any other video chat/chat program into a webpage?

Hi, I am trying to embed Skype or any other video chat/chat program into a webpage. Has anyone had success doing this? or know how? Thanks Phil (2 Replies)
Discussion started by: phil_heath
2 Replies

5. What is on Your Mind?

Very Funny and Somewhat Amazing 2006 Chat Bot Chat

Working on the badging system, Just found this old thread for 2006 and started reading it. ROTFL ... what a great discussion between forum members and our chat bot Gollum "back in the good old days"... You must check this out if you want a laugh and big smile: ... (1 Reply)
Discussion started by: Neo
1 Replies
WVDIAL(1)						      General Commands Manual							 WVDIAL(1)

NAME
wvdial - PPP dialer with built-in intelligence. SYNOPSIS
wvdial --help | --version | --chat | --config | option=value | --no-syslog | section... DESCRIPTION
wvdial is an intelligent PPP dialer, which means that it dials a modem and starts PPP in order to connect to the Internet. It is something like the chat(8) program, except that it uses heuristics to guess how to dial and log into your server rather than forcing you to write a login script. When wvdial starts, it first loads its configuration from /etc/wvdial.conf and ~/.wvdialrc which contains basic information about the modem port, speed, and init string, along with information about your Internet Service Provider (ISP), such as the phone number, your username, and your password. Then it initializes your modem and dials the server and waits for a connection (a CONNECT string from the modem). It understands and responds to typical connection problems (like BUSY and NO DIALTONE). Any time after connecting, wvdial will start PPP if it sees a PPP sequence from the server. Otherwise, it tries to convince the server to start PPP by doing the following: - responding to any login/password prompts it sees; - interpreting "choose one of the following"-style menus; - eventually, sending the word "ppp" (a common terminal server command). If all of this fails, wvdial just runs pppd(8) and hopes for the best. It will bring up the connection, and then wait patiently for you to drop the link by pressin CTRL-C. OPTIONS
Several options are recognized by wvdial. --chat Run wvdial as a chat replacement from within pppd, instead of the more normal method of having wvdial negotiate the connection and then call pppd. --remotename Override the Remote Name setting in the dialer configuration section of the configuration file. This is mainly useful when you dial to multiple systems with the same user name and password, and you don't want to use inheritance to override this setting (which is the recommended way to do it). --config [configfile] Run wvdial with configfile as the configuration file (instead of /etc/wvdial.conf). This is mainly useful only if you want to have per-user configurations, or you want to avoid having dial-up information (usernames, passwords, calling card numbers, etc.) in a system wide configuration file. --no-syslog Don't output debug information to the syslog daemon (only useful together with --chat). --help Prints a short message describing how to use wvdial and exits. --version Displays wvdial's version number and exits. wvdial is normally run without command line options, in which case it reads its configuration from the [Dialer Defaults] section of /etc/wvdial.conf. (The configuration file is described in more detail in wvdial.conf(5) manual page.) One or more sections of /etc/wvdial.conf may be specified on the command line. Settings in these sections will override settings in [Dialer Defaults]. For example, the command: wvdial phone2 will read default options from the [Dialer Defaults] section, then override any or all of the options with those found in the [Dialer phone2] section. If more than one section is specified, they are processed in the order they are given. Each section will override all the sections that came before it. For example, the command: wvdial phone2 pulse shh will read default options from the [Dialer Defaults] section, then override any or all of the options with those found in the [Dialer phone2] section, followed by the [Dialer pulse] section, and lastly the [Dialer shh] section. Using this method, it is possible to easily configure wvdial to switch between different internet providers, modem init strings, account names, and so on without specifying the same configuration information over and over. BUGS
"Intelligent" programs are frustrating when they don't work right. This version of wvdial has only minimal support for disabling or over- riding its "intelligence", with the "Stupid Mode", "Login Prompt", and "Password Prompt" options. So, in general if you have a nice ISP, it will probably work, and if you have a weird ISP, it might not. Still, it's not much good if it doesn't work for you, right? Don't be fooled by the fact that wvdial finally made it to version 1.00; it could well contain many bugs and misfeatures. Let us know if you have problems by sending e-mail to <wvdial@nit.ca>. Also, there is now a mailing list for discussion about wvdial. If you are having problems, or have anything else to say, send e-mail to <wvdial-list@lists.nit.ca>. You may encounter some error messages if you don't have write access to /etc/ppp/pap-secrets and /etc/ppp/chap-secrets. Unfortunately, there's really no nice way around this yet. FILES
/etc/wvdial.conf Configuration file which contains modem, dialing, and login information. See /dev/ttyS* Serial port devices. /etc/ppp/peers/wvdial Required for correct authentication in pppd version 2.3.0 or newer. /etc/ppp/{pap,chap}-secrets Contains a list of usernames and passwords used by pppd for authentication. wvdial maintains this list automatically. AUTHORS
Dave Coombs and Avery Pennarun for Net Integration Technologies, as part of the Worldvisions Weaver project. We would like to thank SuSE and RedHat for adding a number of various cool features to Thanks guys! SEE ALSO
wvdial.conf(5), wvdialconf(1), pppd(8), chat(8). FAQ: http://www.dsb3.com/wvdial/ Worldvisions WvDial May 2001 WVDIAL(1)
All times are GMT -4. The time now is 08:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy