So, a few days ago I had posted this thread (http://groups.google.com/
group/comp.lang.tcl/browse_thread/thread/d4486bcff86ba5c5?hl=en) about
some issues with Expect on the Windows platform(s) not properly
closing the SSH/Telnet processes (i.e. exp_close & exp_wait don't seem
to work like they do on *nix machines, thus eating up more memory,
etc.)
I see that on some other mailing-lists, a few people have ran into
this as well. I don't quite have a solution, but in some sense, there
is a work-around.
Using plink.exe (PuTTY's command-line tool), you can send a single
command on the command line, or specify a file that has multiple
commands to run. I found out that sending one command via the command
line to get the same output as I would using expect, within my Tcl
script:
set data [exec {*}[auto_execok plink] -l <username> -pw <password>
somehost.somedomain "<command to send>"]
....properly closes the connection/process when looking at the task
manager. Then, I can do what I please with the output stored in
$data.
I know this may not going to be suitable for everyone, but I do a lot
of automating of network tasks, working with network devices, etc., so
this would be perfect for anyone who does the same (I would think).
Running multiple commands, you just have to have them in a text file
(one command on each line), and use the following syntax:
set data [exec {*}[auto_execok plink] -l <username> -pw <password> -m
<command file> somehost.somedomain]
Just thought that I'd post this in case anyone else is having these
issues, and needs a possible work-around.
|
|
0
|
|
|
|
Reply
|
scottdware
|
9/3/2010 6:10:32 PM |
|
|
0 Replies
712 Views
(page loaded in 0.037 seconds)
Similiar Articles: Expect on Windows, SSH/Telnet processes not closing properly ...So, a few days ago I had posted this thread (http://groups.google.com/ group/comp.lang.tcl/browse_thread/thread/d4486bcff86ba5c5?hl=en) about some issues with Expect ... Expect scripting on HP - help please - comp.sys.hp.hpuxExpect on Windows, SSH/Telnet processes not closing properly ... scripting a telnet session to VMS - comp.os.vms Expect on Windows, SSH/Telnet processes not closing ... window.open() with username and password - comp.lang.javascript ...Expect on Windows, SSH/Telnet processes not closing properly ..... exec {*}[auto_execok plink] -l <username> -pw <password ... processes not closing properly ... windows ... scripting a telnet session to VMS - comp.os.vmsExpect on Windows, SSH/Telnet processes not closing properly ... scripting a telnet session to VMS - comp.os.vms Expect on Windows, SSH/Telnet processes not closing ... Question: Reverse telnet with a 2509 : does not work on switches ...Expect on Windows, SSH/Telnet processes not closing properly ..... are two bugs waiting to be closed: 1) Windows ... Plus the warm restart of a properly configured ... expect keys per bash - comp.unix.shell... PointedEars Tried various options as per your ... and reinstalled bash, and other coreutils.. i just ... Expect on Windows, SSH/Telnet processes not closing ... sshd closes connection immediately after login - comp.security.ssh ...... not send data after close ... not to have had any problems with ssh. I just disabled the Windows ... not Interix itself. I would no more expect this to work properly ... VNC on XP and dtterm on Solaris 8 - comp.unix.solaris... client, you use either telnet, rsh, rexec, or better off, ssh. ... they look like child processes to ... RealVNC 4.1.1.0 on Windows XP) gets error - "The Connection Closed ... Synchronizing NTP in WAN and LAN - comp.protocols.time.ntp ...For Windows, there may be something in group ... g. ftp, sftp, rsync, or even rsh, telnet, ssh, might ... operating capable of running ntpd, you are not using it properly. How to center a prompt box?? - comp.lang.javascriptThe process goes as follows. The user selects the ... if this is an intranet app and you don't expect ... Is there a way to hide/mask/not show the X (close) of ... Expect on Windows, SSH/Telnet processes not closing properly ...The old Google Groups will be going away soon, but your browser is incompatible with the new version. Expect on Windows, SSH/Telnet processes not closing properly ...So, a few days ago I had posted this thread (http://groups.google.com/ group/comp.lang.tcl/browse_thread/thread/d4486bcff86ba5c5?hl=en) about some issues with Expect ... 7/23/2012 6:29:51 PM
|