in reply to specific field selection

I use the B::Deparse module to convert oneliners into scripts:

perl -MO=Deparse -F: -lane "print $F[2]" checkstatres.txt

gives me:

BEGIN { $/ = "\n"; $\ = "\n"; } LINE: while (defined($_ = <ARGV>)) { chomp $_; our(@F) = split(/:/, $_, 0); print $F[2]; }

as the basic script. Conversion to something usable likely is:

#!/usr/bin/perl -w use strict; $/ = "\n"; $\ = "\n"; open my $fh, 'cciss_vol_status /dev/ciss0 |'; while (defined($_ = <$fh>)) { chomp $_; our(@F) = split(/:/, $_, 0); print $F[2]; }