I want to know How old are my files which are present in the directory. If it is older than seven days I want to delete it from the directory. For that I tried this.
my $command = ;
my @files = `ls` ;
foreach my $file (@files)
$old = `expr $(date +%s) - $(date +%s -r $file)`;
But in these the "$" sign in the command mismatches. I used escape(\) before that. Even its not working. How to do this