#!/usr/bin/perl use strict; use warnings; my $cmd = '/usr/bin/vmstat 1 10|'; open(my $fh, $cmd) or die "Error executing vmstat: $!"; while ( my $line = <$fh> ) { print $line; print '-' x 70, "\n"; } close($fh);