List of process of user

Hi,

I need an output of process running on server, i am executing

ps -ef | grep test

output is

asak   22362     1  0 Nov07 ?        00:00:03 /usr/software/bin/perl-5.8.8 /u/assk/bin/test -v none JOBID=2012117 
asak   23748 22362  0 Nov07 ?      00:00:00 /usr/software/bin/perl-5.8.8 /u/asak/bin/test -v none JOBID=2012117

Two same results are being printed, i want an unique process details, that is.
output should be

asak   22362     1  0 Nov07 ?        00:00:03 /usr/software/bin/perl-5.8.8 /u/assk/bin/test -v none JOBID=2012117

can anyone please let me know how to filter and get unique process using ps command with grep .

Thanks in advance,

-Asak

The two processes are parent/child. Other than using the JOBID segment, which will not work except for that particular scenario try this:

ps -ef | grep test | awk '!arr[$(NF)]++'

This will only work well with the example you gave

hi,

I executed command given by you.

[asak@bon SCRIPTS]$ ps -ef | grep test | awk '!arr[$(NF)]++'
arr[: Event not found.

I got an error..

Event not found 

I need to list out only parent process, is there are any command for that?

Thanks,
Arun

Try this:-

ps -ef | awk '/test/ { if($3=="1") print; } '