Listing processes that are a day older

Hi All,

I am trying to automate some stuff to make my 'to-do-things' easier. I am in need for help regarding this.

I have an output

root 17187  3465  0 23:00:00 ?        0:01 Process1    
root  4975  4974  0 May 12 ?        0:00 Process2    
root  4042 16713  0 Jan 30 pts/22   0:00 Process3
root 17187  3465  0 23:00:00 ?        0:01 Process4
.
. 

I will have to get only the process list which are active more than a day. i.e. Processes that are started on 'May', 'Jun' from the above output.

Here is what i have got so far:

#!/bin/ksh
ps -ef  | grep string | awk '{print $4, $10}' >>$tmp_file
the tmp file should be modified in such a way that it should contain only processes that are active older than 1 day
Please help me out in this part
for i in `awk '{print $2 }' $tmp_file`
do
echo $i >>$tmp_file2
done
mailx -s subject address <$tmp_file2

Thanks,
Sai

on Solaris10:

-> /usr/ucb/ps augxww |egrep "PID|$LOGNAME" |nawk '$9 !~ ":" {print $0;}'

or:

-> ps -ef    |egrep "PID|$LOGNAME" |nawk '$5 !~ ":" {print $0;}'

Thank you very much for the reply..

Can you please brief in what the command does? Sorry for bothering..!

Both methods (running on Solaris, hence the nawk...otherwise, use awk) do a ps listing of the current login's activity. It then evaluates the Start Time column from ps for a timestamp (as opposed to a date), by seeing if it has a ":" within it; if it does, then it's only been started in the last 24 hours. If it doesn't, then output the entire line.

Thanks curleb... Your logic works fine and is really good.

here is the modified script<This looks really fantastic:-):b:>

#!/bin/ksh

ps -ef  | grep string | nawk '$5 !~ ":" {print $11;}' >>$tmp_file

mailx -s subject address <$tmp_file

Thanks,
Sai