Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
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
$dir_A = "/home/tmp/test";
$dir_B = "/home/tmp/DIR_b"@list
= `cd $dir_B/; ls -t`;
$newest1 = '';
$newest1 = $list;
$newwest2 = "$dir_A/file_A";
print "Need to update $dir_A
if (-M "$dir_A" > -M "$newest1");
0 · ·