Re: Expect scripting
- From: Knilges <knilges@xxxxxxxxxxx>
- Date: 19 May 2007 20:51:20 -0700
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 -
.
- Follow-Ups:
- Re: Expect scripting
- From: Cameron Laird
- Re: Expect scripting
- From: Uwe Klein
- Re: Expect scripting
- References:
- Expect scripting
- From: Knilges
- Re: Expect scripting
- From: Knilges
- Re: Expect scripting
- From: Bryan Oakley
- Re: Expect scripting
- From: Knilges
- Re: Expect scripting
- From: Cameron Laird
- Expect scripting
- Prev by Date: Re: Bootable Tcl-Script
- Next by Date: can we use shell-like short key in tcl shell
- Previous by thread: Re: Expect scripting
- Next by thread: Re: Expect scripting
- Index(es):
Relevant Pages
|