find the Root ID from the processes

Hi Friends,

The problem has a simple solution but i am not able to do that, need your help

dmadmin 9558 9511 0 Jan 02 ? 0:00 ./documentum -docbase_name secm1 -security acl -otrace_authentication -init_fil
dmadmin 9552 9511 0 Jan 02 ? 11:27 ./documentum -docbase_name secm1 -security acl -otrace_authentication -init_fil
dmadmin 9846 9511 0 Jan 02 ? 1:57 ./dm_agent_exec -docbase_name secm1.secm1kandocus02 -docbase_owner dmadmin -sle
dmadmin 9511 1 0 Jan 02 ? 2:13 ./documentum -docbase_name secm1 -security acl -otrace_authentication -init_fil dmadmin 9847 9511 0 Jan 02 ? 1:13 ./documentum -docbase_name secm1 -security acl -otrace_authentication -init_fil
dmadmin 9556 9511 0 Jan 02 ? 0:00 ./documentum -docbase_name secm1 -security acl -otrace_authentication -init_fil
dmadmin 9554 9511 0 Jan 02 ? 0:00 ./documentum -docbase_name secm1 -security acl -otrace_authentication -init_fil

As you can see a set of processes, the root process is the "dmadmin 9511 1 "
The only problem is how can i filter it out in my script. I am not very good in awk, can you guys help, a simple grep is looking up for everything which has 1 in it. I just need the line which has "9511 1 ". Basically need to filter out this line which has the Root PID.

After that i can use the awk to print the pid number.
thanks

awk '$2==9511 && $3==1 {print}' filename

Hey that was spot on :):b:, Since i am using the ps comand to fetch the above pids i can use the awk to find my result. Here is the command.

ps -aef|grep dmadmin2|grep document
dmadmin2 18264 18253  0 00:41:28 ?        0:00 ./documentum -docbase_name decm1 -security acl -init_file /apps/docm/dba/config
dmadmin2 18376 18253  0 00:42:20 ?        0:04 ./documentum -docbase_name decm1 -security acl -init_file /apps/docm/dba/config
dmadmin2 18266 18253  0 00:41:29 ?        0:00 ./documentum -docbase_name decm1 -security acl -init_file /apps/docm/dba/config
dmadmin2 18268 18253  0 00:41:30 ?        0:00 ./documentum -docbase_name decm1 -security acl -init_file /apps/docm/dba/config
dmadmin2 18262 18253  0 00:41:27 ?        1:24 ./documentum -docbase_name decm1 -security acl -init_file /apps/docm/dba/config
dmadmin2 18253     1  0 00:41:12 ?        0:12 ./documentum -docbase_name decm1 -security acl -init_file /apps/docm/dba/config

$ ps -aef|grep dmadmin2|grep document|awk '$3==1 {print}'

dmadmin2 18253     1  0 00:41:12 ?        0:12 ./documentum -docbase_name decm1 -security acl -init_file /apps/docm/dba/config

Now i need to get the root pid from this so i modified it to

ps -aef|grep dmadmin2|grep document|awk '$3==1 {print $2}'
18253

Thankyou very much for the quick help.

Regards.