You simply execute the tail program remotely:
my $remote_filename = '/somewhere/over.txt'; my $remote_host = 'rainbow'; my $cmd = "ssh $remote_host tail -f $remote_filename |"; open my $remote_tail, $cmd or die "COuldn't spawn [$cmd]: $!/$?"; while (<$remote_tail>) { print "Remote: $_"; };
In reply to Re: How to tail file on remote host
by Corion
in thread How to tail file on remote host
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |