0
votes

I'm running the tcl(which has expect script) using perl with,

system("C:/Tcl/bin/tclsh86 C:/Users/sysadmin/desktop/expect.tcl");

It's not executing the all commands in the script, but its working fine on ubuntu. What command should i use to run this completely using perl on Windows?

1
Did you install TCL compiler in windows.?mkHun
Yeah, i've installed (tclsh86), its not showing any error, but the complete tcl(expect) script is not executingjohn
how do you know it's not running all the commands? show us something.glenn jackman
Even I tried to run on windows cmd, its giving the same partial output of TCL(expect) script. What can i do for executing the complete script?john
@glenn, In unix i can see the complete output, but if i try to run on windows, the complete thing is not coming as in unix.john

1 Answers

0
votes

On Unix Expect works using virtual terminals. By contrast, Expect on Windows uses the debugging subsystem. (There's nothing like virtual terminals on Windows.) This has the down-side that programs that are marked as being impossible to debug (i.e., some system programs, notably including telnet.exe though ftp.exe might also be on that list) cannot be automated by Expect at all. The OS just refuses to let Expect connect to the process.

Is this what is happening to you? I can't tell from the minimal information you've given, but it is by far the most common reason for problems with porting an Expect script between platforms (once you've taken into account mundane things like different paths and programs that just aren't there on all platforms).

The up-side is that both Tcl and Perl are quite capable of talking directly to anything that you'd use telnet or ftp to talk to (as both are entirely proficient at TCP/IP). In fact, both are probably better at doing it natively than anything you'd likely achieve through use of Expect.