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