From: <BI...@sc...> - 2008-01-24 18:41:53
|
Hello readers, I am working on a project for automating certain sftp file transfers, that will use Net::SFTP::Foreign and the login part will be taken care of by Expect. In order to see what is going on I would like to use the -v option of ssh to get some debug information. Now the problem is that the debug information from ssh (coming on ssh's stderr) is mixed with the information coming from sftp (coming on ssh's stdout) I use code like use Expect; my $conn = Expect->new; $conn->raw_pty(1); $conn->log_user(0); my $ok = $conn->spawn('ssh', '-v', 'user@host', '-s', 'sftp'); # rest of code omitted In this case the program crashes, because the debug information from ssh interferes with the communication protocol for sftp login. When the '-v' option for ssh is not given, the program runs fine, but I don't get debug info from ssh (as could be, hm, expected). Is it possible to have Expect transparently forward the info on ssh's stderr and use stdout for communication? That is, keep stderr and stdout from the spawn program in separate readable streams? Looking forward for response, Bert |