Using the Net::OpenSSH module, how can I connect to a host and subsequently capture/write the output of my command to a file that has been created?
This is my command:
ps -ef | grep jboss | grep java
I have the following perl script so far..
open PATH,">","./report/archive/rpet-$now/path.txt" or die "Unable to create file: $!";
my $ssh = Net::OpenSSH->new(
$host,
user=>$username
passwd=>$password
);
print PATH "SSH Output Would Go Here";
close PATH;
So what is the best way to run the command and print its output? Thanks in advance!