I'm new to Perl and have fallen in love with it as an all in one replacemnt for sh, sed, and awk. I am having trouble with getting the following line to work from within a script. How can this:
perl -F: -lane 'print $F[2]' checkstatres.txtbe made to work in a script. I tried the following, but it didn't work.
#!/usr/bin/perl use strict; use warnings; my @args; @args = ("cciss_vol_status /dev/ciss0 > checkstatres.txt"); open RESULTS, "checkstatres.txt" || die "can't open datafile: $!\n"; while (<RESULTS>){ 'print $F[2]'; }
Any help that this noob can be given is greatly appreciated.
In reply to specific field selection by javpra
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |