Re: utter newbie expect question



On May 29, 11:03 pm, Artis Gripemore <wealthe...@xxxxxxxxx> wrote:
It would appear to be working now. I did change all the sends to
exp_sends, but then the script would not run at all, but that helped
me debug a bit. The problem seemed to be that I had it in
conservative mode. Does that make sense?

So now I have exp_sends, conservative mode off, and a load of sleeps
inserted, and it seems to work in limited testing.

Thanks again; I was completely lost!

On May 29, 4:17 pm, Mark Janssen <mpc.jans...@xxxxxxxxx> wrote:

On May 29, 9:44 pm, Artis Gripemore <wealthe...@xxxxxxxxx> wrote:

This is the error message I get. I don't see the typo, but I assume
that it is there. Any ideas? Thanks again.

wrong # args: should be "send ignore arg"
while executing
"send " " "
invoked from within
"expect -nobrace {<SPACE> to continue} {send " " ; exp_continue}
{Choose one (X,Y,Z} {send -- "y"}"
invoked from within
"expect {
"<SPACE> to continue" {send " " ; exp_continue}
"Choose one (X,Y,Z" {send -- "y"}

}"

On May 29, 2:51 pm, Mark Janssen <mpc.jans...@xxxxxxxxx> wrote:

On May 29, 8:40 pm, Artis Gripemore <wealthe...@xxxxxxxxx> wrote:

Thanks very much! I suppose if I put a ;return after the send -- "y"
that I could break out of this, if I had more script to run after the
match on X, Y, Z?

"(X, Y, Z" {send -- "y" ;return}

Otherwise, it would continue with the next expect statement anyway,
once it timed out, correct?

No, by default the expect command will normally return after a match,
a timeout or a eof has occured. It's the exp_continue in the other
case that will keep on running the expect command so a return is not
necessary. See alsohttp://www.tcl.tk/man/expect5.31/expect.1.html

Mark

It might be that you are having a name collistion with the standard Tk
command send (I cannot test as I am on windows). To prevent the
collision use exp_send instead (which is a good habit to get into
anyway). If that doesn't work, try exp_send -- " ".
Additionally, what is your Expect and Tcl version?

result of: info patchlevel
and of: package require Expect

Or are you using the expect binary to run the script?
Then what does expect -v say?

Mark- Hide quoted text -

- Show quoted text -

Are you using autoexpect by any chance? In that case conservative mode
makes sense.

Mark

.



Relevant Pages

  • SUMMARY: Problem with sys_check V 134
    ... "fg" command. ... And a debug idea ... Modify the sys_check script by inserting a set -x ...
    (Tru64-UNIX-Managers)
  • Re: utter newbie expect question
    ... exp_sends, but then the script would not run at all, but that helped ... me debug a bit. ... So now I have exp_sends, conservative mode off, and a load of sleeps ...
    (comp.lang.tcl)
  • Re: set -x equivalent
    ... I want a trace log from my script in order to debug it. ... Check out the [cmdtrace] command in the Tclx package. ...
    (comp.lang.tcl)
  • svc-volfs fails to maintenance mode
    ... On a Solaris 10 Update 3 SPARC system svc-volfs fails to start. ... service runs the following command. ... Trying to debug I ran this script ...
    (SunManagers)
  • Re: TIP #216: Handling Command-Line Options in Tclsh and Wish
    ... > I have this existing script that can take some command line arguments like ... > package installed then that package will be loaded and my script doesn't ... to load the package "debug" and the result would be as if: ...
    (comp.lang.tcl)