我必须通过通过Expect模块执行的SSH安装的遥控机器。 我必须尽可能分别查阅<代码>STDERR/。 我可以将文字产出(例如)重新定位。
$command = "ssh <script> 2>/tmp/stderr.output"
$exp = Expect->spawn($command) or die "Cannot spawn
";;
my @command1= $exp->expect(5);
but then I have to remotely connect again to check stderr.output
.
Is there a way that expect returns the STDERR
/STDOUT
separately.