Code Comments
Programming Forum and web based access to our favorite programming groups.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!
Post Follow-up to this messageRichard 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
Post Follow-up to this messageOn 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.
Post Follow-up to this messageOn 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
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.