Re: [Expect] Need to have explanations for the use of the expectcommand
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: [Expect] Need to have explanations for the use of the expectcommand

From: Andrew Falanga <not_real@hp.com>
Date: Wed Mar 15 2006 - 21:15:51 CET

Andrew Falanga wrote:
>>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>this the last line you get right?
>>
>>if you put an [ expect -re .*] at the end
>>you will see the trace of succesful login ( or not)
>>
>>if you put an [interact] at this point in your script
>>you will be able to interact with your test setup.
>>
>>what is your next step to accomplish now?
>
> Well, to be honest, the command I'm trying to issue remotely will
> restart some software on the remote box. That wasn't working so I went
> to something more simple (thus the "cd logs; ls" command).
>
> When I run the expect script, it seems to work (I guess). I did as you
> suggest and put an expect .* at the end of the script and it certainly
> doesn't timeout anylonger. However, I don't see the directory listing
> (and yes there are files in that directory). When I execute that
> command at the bash prompt I see the directory listing.
>

Forgot to mention that I figure this is because the expect program has
redirected stdin, stdout and stderr internally.

-- 
---------------------------------------------
Andrew R. Falanga (a non-HP employee)
Hewlett-Packard Company
11311 Chinden Blvd.
Boise, Idaho
---------------------------------------------
Please note: The e-mail address is purposely
mangled.  I do not wish my account at HP to
become a spam haven.
Received on Sun Apr 30 02:34:19 2006