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!
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
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.
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
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
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).