#!/usr/bin/perl use strict; use warnings; my @args; our $F; @args = ("cciss_vol_status /dev/ciss0 > checkstatres.txt"); system(@args); open RESULTS, "checkstatres.txt" or die "can't open datafile: $!\n"; while (){ my @F=split(/:/, $_); if ( $F[2] =~ /OK./){ printf (" it's okay\n"); } else{ printf (" it's not ok\n"); } }