Code:
find2perl $ordner -type f \( -name "*.xml" -o -name "*.eps" \) -type f
Obiges schmeisst schon mal den Perl-Code ohne die Zeiteingrenzung raus, etwas angepasst sieht das dann so aus:
Code:
#! /usr/bin/perl -w
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if 0; #$running_under_some_shell
use strict;
use File::Find ();
# Set the variable $File::Find::dont_use_nlink if you're using AFS,
# since AFS cheats.
# for the convenience of &wanted calls, including -eval statements:
use vars qw/*name *dir *prune/;
*name = *File::Find::name;
*dir = *File::Find::dir;
*prune = *File::Find::prune;
# Traverse desired filesystems
File::Find::find({wanted => \&wanted}, '/DEIN/SUCH/PFAD');
exit;
sub wanted {
my ($seconds);
($seconds = (stat($_))[9])
&& -f _
&& (
/^.*\.xml\z/s
|| /^.*\.eps\z/s
)
&& -f _
&& ( $seconds < (time - (60 * 60)) )
&& print "$File::Find::name\n";
}
Lesezeichen