Hi guys!
One of you kind folks have written the following...
--------------------------
----------
----------
----------
----------
--
#!/usr/bin/perl
use File::Find;
find(sub {push @f,$File::Find::name if /^list.*\.pl/;}, ".");
open LOG,">logfile.log";
for (@f) {
print LOG "$_:",system("perl $_"),"\n";
# if the output of the script to be run indicates failure/success then
# print LOG "$_:",`perl $_`,"\n" ;
}
close LOG;
--------------------------
----------
----------
----------
----------
-------
What Id like is to change this a bit so that...
1) It includes a search for any files called 'update.pl'
2) When it returns the findings, it first changes to the directory where the result is, THEN runs that script.
The reason i want this is that there is a problem if i dont run the update.pl from the current directory in which update.pl resides.
3) Also, what would be fantastic is that the script continues if there is a failure on one of the executions, but still logs the error.
Any help greatly appreciated.
Start Free Trial