Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
How to print the grep command,#!/usr/bin/perl my @filename = qw{filename1 filename2 filename3}; my @datas =qw{DATA1 DATA2}; my $i; $i=0; while($i < scalar(@filename)) { $count = `grep -c "$data[$i]" $filename[$i]`; print "$tags[$i]:$count\n"; $i++; }
Please tell me how can I do thisgrep -c data1 filename1 grep -c data2 filename1 grep -c data1 filename2 grep -c data2 filename2 grep -c data1 filename3 grep -c data2 filename3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Print array values
by si_lence (Deacon) on Aug 10, 2009 at 11:11 UTC | |
by cdarke (Prior) on Aug 10, 2009 at 11:47 UTC | |
|
Re: Print array values
by desemondo (Hermit) on Aug 10, 2009 at 12:01 UTC | |
|
Re: Print array values
by bichonfrise74 (Vicar) on Aug 10, 2009 at 23:56 UTC | |
by ikegami (Patriarch) on Aug 12, 2009 at 15:01 UTC |