in reply to File Search

That might be impossible to do on a Unix system, because Unix does not keep track of creation times of file or directories. "Creation time" is ambiguous. Assuming that 'foo' exists, and 'bar' doesn't, does "mv foo bar" create bar?

But assuming you know the directories to search by some divine means, no need for Perl. Something like the following will do:

$ find dir1 dir2 dir2 -name '*.out' \ '!' -exec grep -q error {} ';' \ -exec sh -c 'echo "Whatever" | mail you@there.fo +o' ';'

Abigail

Replies are listed 'Best First'.
Re: Re: File Search
by agentv (Friar) on Oct 23, 2003 at 22:24 UTC
    ...isn't that a little bit literal-minded?

    In my reading of the problem, I concluded that the creation time was also the likely most-recent modification time. Especially in the subsequent clarification of the problem statement, it seemed clear to me (although not necessarily true) that the issue was to avoid analyzing files from previous runs of the procedure. In such a case both the mod time and the inode-change time of old files are likely to have been unchanged during the most recent program run.

    I'm all for clarifying that ctime is not the "creation time" but the initial statement here, "That might be impossible to do on a Unix system" really caught me by surprise. Had it not come from a credible source, I would likely have ignored the remainder of the message.

    ...All the world looks like -well- all the world, when your hammer is Perl.
    ---v