Create a list of all files which should be there, and compare.
Code:
perl -le 'for my $i (1..50) { print "missing: statistics.$i" unless -f "statistics.$i" }'
I meant for the
Perl script to just generate the list, but it turned out to be so easy to do it all in
Perl. Sorry, folks (-:
Just to illustrate my original proposal, here's another approach, using just simple shell commands:
Code:
yes . | head -50 | nl | sed -e 's/^ *\([1-9][0-9]*\) .*/statistics.\1/' >list
ls -rt statistics.* | diff list -
The file "list" is generated with the
nl utility to have line numbers, and the file name prefix is added using
sed. (This came out pretty tortured -- it would arguably be a lot easier with awk, but let's just say that using scripting languages would be cheating, okay?) Then we compare that list against the actual directory listing. This requires that your diff accepts "-" to mean "read the other file from standard input;" otherwise, you'll need to use two temporary files. (Don't forget to remove them when you're done.)