#!/usr/bin/perl -w # reformat output from vmstat use strict; open(my $fh, "/bin/vmstat -s |") || die "vmstat"; while (<$fh>) { chomp; s/^\s\s*//; my ($first, @rest) = split; printf "%10s ", $first; print "@rest\n"; } close($fh); exit(0);