in reply to Re: File Search
in thread File Search

I am using a subset of your suggestion, but am getting an error when trying to open the file to read it.
use File::Find; find(\&wanted, '/opt/psoft/hr83tst/appserv/prcs/HRTST/log_output/'); print $_ ; sub wanted { return unless /\.out$/; open F, $_ or return ; while (defined (my $line = <F>)) { if (-M $_ < 0.5) { print $_ if $line =~ /error/ ; system("mail -s' $_' mikev\@beverlycorp.com<$line"); return; } } close F; }
This is teh error being returned - "A file or directory in the path name does not exist. sh: error: 0403-016 Cannot find or open the file." Any help is greatly appreciated.

Replies are listed 'Best First'.
Re: Re: Re: File Search
by Aragorn (Curate) on Oct 27, 2003 at 19:35 UTC
    sh: error: 0403-016 Cannot find or open the file
    It looks like the system command goes wrong, or more specifically, the shell which is started by system can't start the mail program. Is the directory where mail is located in your PATH? Does the mail program even exist?

    Arjen

      Yes the mail command is in the path, and yes it exists. I have attempted to preface the command with the full path ie /usr/bin/mail, but recieved the same error message.