Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

send_user - invalid command name - autoexpect
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!


Report this thread to moderator Post Follow-up to this message
Old Post
Richard Lund
04-03-08 12:58 AM


Re: send_user - invalid command name - autoexpect
Richard Lund wrote:
> 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...

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


Report this thread to moderator Post Follow-up to this message
Old Post
schlenk
04-03-08 12:58 AM


Re: send_user - invalid command name - autoexpect
On Apr 2, 8:15 am, Richard Lund <rl...@mninter.net> wrote:
> 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!

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/Ac...nux-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.


Report this thread to moderator Post Follow-up to this message
Old Post
vitick@gmail.com
04-03-08 04:02 AM


Re: send_user - invalid command name - autoexpect
On Apr 2, 7:50 pm, vit...@gmail.com wrote:
> On Apr 2, 8:15 am, Richard Lund <rl...@mninter.net> wrote:
>
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> 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):
>
>  ++++++++++++++++++++++++++++++++++++++++
+++++++++
>
> 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/ActiveTc
l8.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

Report this thread to moderator Post Follow-up to this message
Old Post
vitick@gmail.com
04-03-08 04:02 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Tcl archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:24 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.