I am interested in writing a fancy program to kill processes and could use
some advice on appropriate tools, languages, and approaches.
I would like the program to function as follows:
There will exist a command line switch to correspond to each process
characterstic. A process characteristic will most likely be each of the
fields displayed in a full process list (ps -ef on many systems.) Using
these switches, a user will be able to specify one or more characteristics
with the ability to use regular expressions. Also, where appropriate, he
or she may include processes to be killed by using equalities/
kill -n x*
would kill xterm, xrn, xmosaic, etc.
kill -n x* -t >=5h2m
would kill all processes beginning with lowercase x and which have been
running at least than five hours and two minutes.
These examples are provided to give a basic idea--I haven't worked out the
Lastly, I would like the user to be able to specify criteria for EXCLUDING
processes based on values for these same characteristics.
Can you please help with the following questions:
1) What tools or languages would be best to use? C, Tcl, scripting langs,
LEX & YACC, etc.
2) What are some good strategies and their pros and cons for implementing
this functionality in different software forms i.e. script, program,
3) Are there any guidelines or tips for designing the syntax to jive with
Thanks so much for your help.