Re: Expect scripting




You're working too hard.

Yeah, probably. But, if I don't use my time constructively then I am
hanging out on the golf course enjoying sunny days... that can't be
good for me!


However, there's an excess of noise in your presentation;
this makes it difficult for us to help effectively.

noise?

Even
leaving aside such stylistic matters as the $mode revalu-
ation, unnecessary reliance on [exec]



I couldn't think of how to capture text from a telnet session so again
I reverted to what I am familiar with which is script and used exec
although I though spawn would do the same thing. What is the
difference there? My thoughts were that exec is using the shell and
spawn is basically doing the same. Is that misguided?

, and superfluous
\-escapes, a line like
set activeFile [open $home/ke010596/$equipid\cmdfile.txt"]
gives me deep doubt about how accurately you've rendered
the situation (what's with the unbalanced ", and do you
really intend what is more conventionally written
${equipid}cmdfile.txt
?).


I did, but when I tried it I did it incorrectly because originally, I
had $equipidcmdfile.txt was getting that the var $equipidcmdfile was
not found. But I thought to use braces, {?equipid}, to segregate the
var but that didn't work so I reverted to '\' but now that you pointed
out my mistake I corrected that. The unbalanced " was typo in my
email not in the code.

As written, this program *can't* "hang"; it *must*
send $line\r

Okay but as written is $line garanteed to be filled? Or is the
problem that $line is not getting anything? I can say the $
{equipid}cmdfile.txt does have a line that is a valid command to the
system it is suppose to be sent to," utl::qry.who! ". The ! is the
system's \n character.


if perhaps with timeouts intervening.

This made me look at my code again and after the password is
successful I had it waiting for a ! which was never going to appear
without a \r being sent instead it should have been waiting for COMPL.

Are you *sure*
COMPL is the exact prompt from the remote processor?

Yes. If the command were to be entered to the telnet session to this
piece of equipment the response for every command is COMPL.


I strongly recommend you read <URL:http://wiki.tcl.tk/3173>.- Hide quoted text -

Recommendation appreciated and will be taken. Thank you.

But I guess the short of it is, not that I am discouraged, my code is
a mess and heaven help me!

- Show quoted text -


.



Relevant Pages

  • Re: wScript.Shell Problems
    ... the completion of the underlying process. ... However, the Exec procedure is ... Here is why i went to the RUN command, it is my understanding that the ... EXEC command does not allow for the BOOLEAN indicating wether the ...
    (microsoft.public.scripting.vbscript)
  • Re: Problem in calling c programs and compiling them in tcl/tk
    ... Are you using Tcl's glob command to do this? ... using exec gcc filename.c and later exec ./a.out filename.c. ... the execution of a command that might generate a Tcl error. ... i can call a c program and compile it? ...
    (comp.lang.tcl)
  • Re: xp_cmdshell default path (system32) problem
    ... exec xp_cmdshell @cmd1 ... - specify the full path in the del command ... ensure that xp_cmdshell ALWAYS executes under the security context of ... I haven't executed the actual erase statements yet but rather have been ...
    (microsoft.public.sqlserver.programming)
  • Re: Literal pipes in [open "|cmd..."]
    ... If it's not an [exec] directive, ... away with the intermediary pipe directives entirely also (or more ... As for a new command with a clean syntax, the only way you're going to ... fileevent $ou write $arg ...
    (comp.lang.tcl)
  • Re: Sleep freezing
    ... >> man exec. ... > form of a standard shell pipeline where each arg becomes one ... > word of a command, and each distinct command becomes a sub- ... The word "execute" means to replace the program running in the calling ...
    (comp.unix.shell)