Hi,
I want to compare a file "A" with all files in a directory call "DIR_b" and if file "A" has timestampe older than any file in "DIR_b" then report file "A" need to update.
Here is my code but it does not work
Thanks,
Tony
#!/user/bin/perl -w
$dir_A = "/home/tmp/test";
$dir_B = "/home/tmp/DIR_b"
@list = `cd $dir_B/; ls -t`;
$newest1 = '';
$newest1 = $list[0];
$newwest2 = "$dir_A/file_A";
print "Need to update $dir_A \n"
if (-M "$dir_A" > -M "$newest1");