HI everyone, I need help plz, to write a Linux shell script :
write a utility program called spy that enables you to do just that. spy repeatedly scans the system process table, displaying processes that have started or ended since the last scan.
The usage of spy is this:
% spy [ list of patterns] [-t secs] [-n count]
Here's what each field means: list of patterns: Is a list of patterns to look out for in the process list, possibly containing regular expressions, described briefly below. If no list is present, spy accepts all processes. tsecs: Tells spy how many seconds to wait between each scan of the system process table.
The default value is one. count: Tells spy how many times the system process table should be scanned before quitting. The default value is five. During each scan, spy produces an intermediate file containing a list of current processes in the form: User- id process-id command which it then compares with the list constructed during the last scan.
The differences between the two lists indicate which processes have ended and which have begun since the last scan. This difference is then displayed, in a readable format together with the date and time.