Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

expect + minicom + 'at' command

616 views
Skip to first unread message

ne...@pro.wp.pl

unread,
Jan 4, 2006, 8:21:53 PM1/4/06
to
Hi all
I'm new to expect. Today i've downloaded and installed it without any
problems. After that i've made simple script which logs into cisco
router
then changes some configuration and exits.
It works from command line but it doesn't work from command 'at'
(didn't try
from cron, but probably the same thing). I've search internet to find
the
solutions. Couldn't find good explanation what is wrong. Can you help
me??
I've spend all day trying to fix it...no luck unfortunatelly.
Fedora Core 3.
spawn minicom

send: spawn id exp3 not open
while execution
"send -- "\r""
(file "script.exp" line 57)

Cameron Laird

unread,
Jan 4, 2006, 11:08:05 PM1/4/06
to
In article <1136424113.8...@g47g2000cwa.googlegroups.com>,

ne...@pro.wp.pl <ne...@pro.wp.pl> wrote:
>Hi all
>I'm new to expect. Today i've downloaded and installed it without any
>problems. After that i've made simple script which logs into cisco
>router
>then changes some configuration and exits.
>It works from command line but it doesn't work from command 'at'
>(didn't try
>from cron, but probably the same thing). I've search internet to find
.
.
.
Read <URL: http://wiki.tcl.tk/cron >, then ask again.

ne...@pro.wp.pl

unread,
Jan 5, 2006, 4:50:56 AM1/5/06
to
Of course i was there....but...first... i wanted to use 'at' command to
avoid problems with cron. With at the jobs are executed using the
current environment and directory that was active when the job was
submitted. It should work, but it doesn't. Besides that i'm newbie with
tcl/expect. Maybe someone know what does this error mean.

Uwe Klein

unread,
Jan 5, 2006, 5:12:44 AM1/5/06
to

2 points:
1.
do an [expect] before you try to do [exp_send]
you will probably get the errormessage from minicom
2.
is there a special reason using minicom?

what about:
# open the serial device
set fd [ open /dev/<myttydevice> { NONBLOCK RDWR} ]
# set baudrate, handshake, encoding ..
fconfigure $fd -mode <to my liking>
spawn -open $fd

expect ..
exp_send ..


uwe

add:just to give a reference:

expect1.1> spawn minicom
spawn minicom
30500
expect1.2> expect
minicom: WARNING: configuration file not found, using defaults
minicom: cannot open /dev/modem: No such file or directory
expect1.3> expect
expect: spawn id exp4 not open
while executing
"expect"
expect1.4>

0 new messages