The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: PERL Code
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-05-2008
talashil talashil is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 61
PERL Code

I have a code block ...

$cmd = "find $audit_dir -mtime +$days_to_keep -exec rm {} \\;";

unless(open(CMD, "$cmd |")){
$msg = "Error command : $cmd \n\n";
print_log $lgh,"$msg",1;
exit 1;
}

print_log $lgh, "Deleting physical files with Command : $cmd ", 1 if verbose;

while ($line=<CMD>) {
print_log $lgh, "Physical files older than $days_to_keep deleted from $audit_dir", 1 if $verbose;
}


after it executes the print_log , it's not going inside the while loop ..

what am I missing here ?

Thanks