Visit The New, Modern Unix Linux Community

Operating Systems Linux How do I capture responses from the chat command? Post 302495452 by Bashingaway on Thursday 10th of February 2011 10:12:45 AM

Thanks for the ideas but I'm afraid the way you're suggesting doesn't work, not because of your code but instead the 'inconsistency' of the way the modem(s) outputs the data. Some insert line feeds or carriage returns at different places and it requires too much 'pre management' to account for all the variables.

I have found a sort of way to do it with chat, I cannot get REPORT to work and suspect it's the same problem as above, however by using the -v option the output gets pushed to the /var/log/messages logfile and I can pick up what I want from there.

So my last step is how to do the following....

The modem gets reset and as a result the 'timing' of when it comes back stable is variable. The only way I've identified to be certain it's back is an entry in the var/log/messages file that reads "now managed".

So what I wanted to do was something like....

while [ ` tail -f /var/log/messages | read -r LINE | echo "$LINE" | grep "now managed" ` ]; do

echo got here


I realise the above line won't work but has anyone previously written a bit of code that keeps reading /var/log/messages till a specific message comes up and then continue running the script?

Thanks in advance.
Test Your Knowledge in Computers #815
Difficulty: Medium
In CSS, E[foo] matches an E element with a 'foo' class name.
True or False?

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
vgetty(8)							   vgetty manual							 vgetty(8)

vgetty - voice extension to the mgetty+sendfax program SYNOPSIS
vgetty [options] ttydevice vgetty is not meant to be run from the command line. It should be run from the /etc/inittab file so it can respawn after each call. Here is a typical inittab entry: S0:345:respawn:/usr/local/sbin/vgetty ttyS0 If you already have a line in your inittab file which invokes mgetty, replace it with vgetty, since it replaces/extends its functionality. DESCRIPTION
vgetty is an extension to the mgetty+sendfax program which provides an interface to voice-capable modems. Use it to operate your modem as a simple answering machine or build your own sophisticated voice messaging system. vgetty handles all the voice-modem specific protocols, giving application programs a uniform, modem-independent voice library. Supported modems include many common serial modems from 3com/USRobotics, Elsa, Multitech, ZyXEL, and others. Caller ID and Distinctive Ring are supported provided you have subscribed to these services from your phone company. Software-based modems (winmodems) are not supported. vgetty comes with tools to convert au/wav/voc sound files to/from the format used by most supported modems. Basic editing and filtering of sound files is included as well. See pvf(1) for more information. OPTIONS
vgetty accepts the same options as mgetty. The one's relevant to voice mode are given here. See mgetty(8) for other options related to data and fax modes. -a Use autobauding (change port speed to modem CONNECT speed). There is no voice modem that needs this, the option is just documented for completeness. -m 'expect send ...' Set the chat sequence that is used to initialize the modem. For an empty expect part, use empty double quotes (""). Since the sequence contains spaces, you will have to enclose all of it in single quotes (''). Example: vgetty -m '"" ATH0 OK' -n <rings> Set the number of rings after which vgetty will answer the phone -s <speed> Set the serial port speed to use, e.g. "-s 38400". This is the speed of communication between the computer and modem in bits/sec (baud). -x <log level> Set the log verbosity level. Zero (0) means no logging, six (6) is really noisy. Use level six (6) when sending problem reports to the maintainer. The log file is /var/log/vgetty.ttyXX. ENVIRONMENT
vgetty sets the following environment variables when calling external programs: CALLER_ID The caller's telephone number. CALLED_ID The number the caller has dialed. Useful for ISDN with multiple incoming phone numbers on the same physical line. CONNECT The connect string as reported by the modem (e.g. "38400/V.32bis/V.42bis ... ", etc.). DEVICE The tty device being used (e.g. "ttyS0"). Useful for handling multiple devices ("messages on this line are for work, messages on the other line are personal"). RESOURCES
vgetty is included in the mgetty+sendfax distribution. For the latest release, go to: The vgetty maintainer's home page is at: Send problem reports to: For information on mgetty, go to: The mgetty mailing list is at The mailing list is mirrored to the de.alt.comm.mgetty newsgroup. FILES
/etc/mgetty+sendfax/voice.conf Main configuration file for vgetty. Many options here override the equivalents found in /etc/mgetty+sendfax/mgetty.config /etc/nologin.ttyXX If this file exists, vgetty will not answer calls on device ttyXX. /var/log/vgetty.ttyXX Debug log file for vgetty. /var/spool/voice/messages/Index List of greeting messages to use. /var/spool/voice/.code Access code for remote playback of messages using the script /var/spool/voice/.flag vgetty touches this file when a new message is received /var/spool/voice/.timestamp Used by the script to record last time of message playback DIAGNOSTICS
If vgetty doesn't work they way you think it should, check the log file. By default, it is located in /var/log/vgetty.ttyXX (for the vgetty process handling device ttyXX, e.g. ttyS0). BUGS
vgetty supports most standard voice modems, but many modems are not fully compliant with relevant standards or contain firmware bugs. If you have problems, try upgrading your modem to the latest firmware revision. If you discover a bug with how vgetty reacts to your modem, please email the maintainer ( describing your problem. Include relevant excerpts from the log file (set log level to six first), and details about your modem (including firmware revision) and operating system. SEE ALSO
mgetty(8), pvf(1) COPYRIGHT
vgetty is Copyright (c) 1997-2001 Marc Schaefer ( and many others, before and after. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This man page was written by Barry Stewart <>, and has CVS version: $Id: vgetty.8,v 1.1 2001/12/22 18:43:22 marcs Exp $ version 0.60 $Date: 2001/12/22 18:43:22 $ vgetty(8)

Featured Tech Videos

All times are GMT -4. The time now is 10:58 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy