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

send_user - invalid command name - autoexpect

79 views
Skip to first unread message

Richard Lund

unread,
Apr 2, 2008, 11:15:09 AM4/2/08
to
Hi,

with the help of a friend I finally figured out how to run a TCL script
in Linux, and I already have the first problem...
(Not surprising since I'm a Linux and TCL newbie)

I use Ubuntu, and I used the terminal to install it's own TCL and Expect
(or rather my friend did).

So I run autoexpect:
tcl autoexpect.tcl
and I get this error message:

Error: invalid command name "send_user"
while executing
"send_user -- $s"
(procedure "verbose_send_user" line 5)
invoked from within
"verboxe_send_user "autoexpect started, file is $filename\n""
(file "autoexpect.tcl" line 249)

I tried to figure out why send_user won't work, and I realized that if I
start expect first and then enter send_user as a command, it tells me
about it's command parameters, so I guess the script I am trying is
somehow not starting expect.

I am using the original autoexpect.tcl script from the expect website
(http://expect.nist.gov/example/).

It's source code starts with
#!../expect --
Is that enough to tell it to use Expect?
Or do I have to edit the path or add something to the default path?

Considering I only know my Windows command prompt, I think I got pretty
far ;-)
But I'm still stumped at this point, and I didn't find an answer through
Google, either...

Any ideas?

Thanks!

schlenk

unread,
Apr 2, 2008, 11:26:35 AM4/2/08
to

Probably a

package require Expect

near the start auf your autoexpect.tcl fixes it.

Btw. with 'tcl' you don't start a regular Tcl, you start the shell
from tclx. The regular tcl shell is tclsh. Shouldn't really hurt in
your case.

Michael

vit...@gmail.com

unread,
Apr 2, 2008, 10:50:13 PM4/2/08
to

Since you are new to this the best thing to do is to download a
complete installation of TCL aka ActiveTcl. At the command line you
can do this (copy, paste, enter after each line):

+++++++++++++++++++++++++++++++++++++++++++++++++

wget http://downloads.activestate.com/ActiveTcl/Linux/8.4.18/ActiveTcl8.4.18.0.284097-linux-ix86.tar.gz
tar zxvf ActiveTcl8.4.18.0.284097-linux-ix86.tar.gz
./ActiveTcl8.4.18.0.284097-linux-ix86/install.sh

+++++++++++++++++++++++++++++++++++++++++++++++++

Follow the the installation prompts, pick the defaults, when finished,
run the following (copy, paste, enter):
/opt/ActiveTcl-8.4.18/bin/tclsh /opt/ActiveTcl-8.4.18/demos/Expect/
autoexpect

That should work.

vit...@gmail.com

unread,
Apr 2, 2008, 10:56:37 PM4/2/08
to
> wgethttp://downloads.activestate.com/ActiveTcl/Linux/8.4.18/ActiveTcl8.4....

> tar zxvf ActiveTcl8.4.18.0.284097-linux-ix86.tar.gz
> ./ActiveTcl8.4.18.0.284097-linux-ix86/install.sh
>
> +++++++++++++++++++++++++++++++++++++++++++++++++
>
> Follow the the installation prompts, pick the defaults, when finished,
> run the following (copy, paste, enter):
> /opt/ActiveTcl-8.4.18/bin/tclsh /opt/ActiveTcl-8.4.18/demos/Expect/
> autoexpecthttp://downloads.activestate.com/ActiveTcl/Linux/8.4.18/ActiveTcl8.4.18.0.284097-linux-ix86.tar.gz
>
> That should work.

Google truncated the link, it should be the following,
after ....downloads.activestate.com :
/ActiveTcl/Linux/8.4.18/ActiveTcl8.4.18.0.284097-linux-ix86.tar.gz

Richard Lund

unread,
Apr 4, 2008, 9:54:32 AM4/4/08
to
schlenk wrote:
> Probably a
>
> package require Expect
>
> near the start auf your autoexpect.tcl fixes it.


That did it!
Thanks!

Now I have other issues, but I'll create a new post about that *g*

vitick:
Also thanks for your input! I asked my admin, and he said not to install
ActiveTCL, and I have no idea why, but he can get that way sometimes...

Richard

vit...@gmail.com

unread,
Apr 4, 2008, 11:22:54 AM4/4/08
to

I know how that goes. I such case I would install it in my home
directory, since it will/should run from there (does for me). Or
download one of the tclkit or freewrap binaries (one file TCL binary
that runs standalone, nothing else required).

0 new messages