I am new to working with Linux/Unix. I created a file which executes set of expect commands. It works fine, when I am running it from command prompt. I have written a program that executes series of commands using the program test.expect.
I am using java 1.7, expect 5.1 and Windows NT system.
I am trying to run the commands from program using
This is creating a text file, but it has no values.
Can some one help me. I am trying to run set of commands.
I tried another approach, where I created a batch file and processing the batch file, but the problem is that, the command takes 50sec to execute and all the commands are not executing.
Aside form the syntax error is the code you posted (the extra " right after >> on line 4), I suspect that "expect" outputs information to stderr and not to stdout. So try also redirecting stderr:
p = rt.exec("cmd /c expect a b >> c:/test.txt 2>&1");
Also, since this has nothing to do with Linux, I'll move this post to a more appropriate location.