Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CU Passing an AT command to a modem in a shell script

Status
Not open for further replies.

AMSTech

Technical User
Oct 1, 2001
13
0
0
US
I have a modem set up on my tty2. Does anyone know how to pass an at command to the modem in a shell script after the cu connects?
 
Are you already connected to the remote customer? i.e. did you define a system in the /etc/uucp/Systems which contains the details for cu to connect? E.g.

otherhostname Any ACU 19200 5555000

If so, why do you want to do an "at" command? By running the "cu otherhostname" the modem will dial and connect to the defined phone number (555-5000)using the definition for ACU in the /etc/uucp/Devices file to find the tty port and modem port.

If you would want to automate a connection and transfers I would suggest to install "expect" for that, it works well. Below is a sample of what can be done with expect when connecting to a BBS:

#! /usr/local/bin/expect -f
set timeout -1
spawn cu otherhostname
expect "What is your name:"
send "username\r"
expect "Y,n"
send "\r"
expect "Password:"
send "password\r"
expect "ENTER"
send "\r"

etc...

Hope this what you were after....

IBM Certified Specialist - MQSeries
 
Thanks, I should have stated what I was trying to do first. I am trying to set up a script so my billing people can dial out to a BBS just to look up information. No downloads or uploads.
 
Here is a dumb question... How do I load Expect???
 
You will probably have to install expect, you can find it the AIX package at or the source code at
To run an expect script you should ensure that the path is correct at the start of your script, very much like perl scripts, as per previous example:

#! /usr/local/bin/expect -f

Did you manage to set up the Device and Systems files correctly? If your billing people are going to do it interactively all you will need to do is set this up properly, all they then do is type &quot;cu <otherhostname> and Bob's your uncle.

Chris



IBM Certified Specialist - MQSeries
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top