Languages and Scripting

New to scripting, grateful for any help !!

Go to solution
James R. Ferguson
Acclaimed Contributor

Re: New to scripting, grateful for any help !!

Hi (again) Jeremy:

> ...this may be a stupid question, but I'm assuming the REF file should contain a listing of what files have been read/checked. My question is, where/how do I define the directory that I need to check where all the files are held ?

No, the 'REFFILE' is only used to create a mark-in-time (for you, every 5-minutes). We use this to decide if a file is newer (more recently changed) since the last mark.

If at sometime, t[n], a file meets the principal criteria of having the string "ABORT" somewhere on line-12, then we report the event. Then, at some later time, t[n+m] another change to the file is made. This triggers a re-examination of the file and a second report for the file.

If this is _not_ what you want, there are ways to circumvent that. You could filter the output through a 'sort -u' to reduce the results to unique entries.

You could also store the name of any file meeting the match criteria in a hash (associative array in 'awk' parlance). Then, skip repetitive output for any file once added to the hash.