Thread Dateinameliste und Größe?
(5 answers)
Opened by Math55 at 2003-08-19 19:55 Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 my $filename = '???'; my @filelist = qw(/usr/bin/perl /usr/local/bin/perl); # suchmuster vorbereiten (ineffizient bei grosser @filelist) my $searchString = join("|", map {quotemeta($_)} @filelist); unless (open (FILE, $filename)) { die "Error: couldn't read '$filename': $!\n"; } else { while (<FILE>) { chomp($_); my ($size, $filename) = split(/\s+/, $_, 2); # es koennen ja auch Leerzeichen im Dateinamen sein... if ($filename =~ /^($searchString)$/o) { print "$filename: $size\n"; } # if } # while close (FILE); } # else <!--EDIT|Strat|1061377783--> perl -le "s::*erlco'unaty.'.dk':e,y;*kn:ai;penmic;;print"
http://www.fabiani.net/ |