in reply to Doubt regarding find and grep command

Sounds like you have a specified place for the nightly logs. To get a listing of the ".log" files, adapt this code which lists the ".pl" files in my C:/temp directory...

#!/usr/bin/perl -w use strict; my $path = "C:/temp"; opendir (my $dirhandle, $path) || die "cannot open dir $path"; my @perl_files = grep {/.pl$/} readdir $dirhandle; print "@perl_files";
A directory is opened, then all files in that directory are read and filtered by grep{}. Note that a directory within that directory is just a special kind of "file", but filtering on things that end in ".log" probably eliminates them, but be aware that it might not, that case you need a file test, like "-f".

In your case, I would think that: $path="/pptai/nightly_db/data_loader_logs"; along with "grep{/.log$/}" would yield all log files. Note that if you want to do a "file test" like -e, -f, etc, you will need to test the complete file path name, "$path/$specific_file". Above @perl_files only contains the file names, not the full paths. Oh, also enclose "$path/$specific_file" in quotes otherwise Perl will think that you are doing division!