hymkor/expect

Redirect output?

mem16421 opened this issue · 1 comments

I would like to use this program to logon run a remote command and logout the remote host. It does this very well, thank you! But I would also like to redirect the output/stout to a file. When I try this I get invalid handle. If there a way to workaround this issue in a batch file?

It may be difficult because expect.exe does not read process's standard-output and reads the console-buffer directly.

The reason why expect.exe does not read stdout is that some prompts for password are not flushed immediately when stdout is redirected, then the expect-function waits forever.