in reply to IO::Select & ssh problem
Don't know about your problem. What's the error? (include $! in your error message).
The following isn't very safe:
my $cmd1 = "cat /etc/passwd"; my $sshcmd = "/usr/bin/ssh -t -i \$HOME/.ssh/mypubkey -o 'StrictHostKe +yChecking no' user\@host $cmd1"; open(IFILE, "$sshcmd |") || die "Bad open";
my @cmd = (cat => ( '/etc/passwd', )); my @sshcmd = ('/usr/bin/ssh' => ( -t => (), -i => "$HOME/.ssh/mypubkey", -o => 'StrictHostKeyChecking no', 'user@host', @cmd )); open(my $fr_ssh, '-|', @sshcmd) or die("Can't fork and pipe: $!\n");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: IO::Select & ssh problem
by cmv (Chaplain) on Sep 18, 2009 at 18:52 UTC |