I Have HPUXB.11.23
I need a command, for find the process with more 12 hours executing
If I execute the following, which is just a long command that will wait forever
grep 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa abcd'
then grep -f can't find the process, if I search for abcd which is contained in the last segment of the long command.
ps auxww|grep abcd finds the process, but I can't use it in a script, as it also finds the grep process self.
My C program executes commands in a bash shell. To do this, I fork and in the child process I run:
char* command = "..."; /* provided by user */
execlp("/bin/bash", "bash", "-c", command, NULL);
If this is a long running command, I would like to have the option of killing it.