I am having problems with ssh'ing to a remote machine and open a text file on that machine using Perl. I am currently tailing the file as seen below,
my $remote_filename = '/export/home/fsv/sample.txt';
my $remote_host = 'bs16-s1.xyz.com';
my $cmd = "ssh -l $sshUser $remote_host tail -f $remote_filename |";
open $inFile, $cmd or die "Couldn't spawn [$cmd]: $!/$?";
The connection times out and I see that file is not even close to being opened. I tried using Net::SSH and Remote::FIle as well with no avail. It would be great if I could get some assistance on this.
Thanks for your time.