excellent 90% work is done only a simple issue now iam getting both the lines cn: PUN/PROJ/RAJENDRA TEKADE mail: [email protected] -- cn: PUN/PROJ/KIRAN PANDHE mail: [email protected] --
but i like to get only mail entry as result not both cn & mail enty thanks and regards --- On Wed, 17/12/08, aDil <[email protected]> wrote: From: aDil <[email protected]> Subject: Re: [Linux_Mantra] advanced search script required To: [email protected] Date: Wednesday, 17 December, 2008, 5:47 PM try this grep -A 1 ¨pattern¨ file Adil Quraishi ____________ _________ _________ __ From: ashok abraham <ashok...@yahoo. com> To: linuxvadapav@ yahoogroups. com; Linux_Mantra@ yahoogroups. com Sent: Wednesday, December 17, 2008 5:36:47 PM Subject: [Linux_Mantra] advanced search script required i have my entire organisation adress book details stored in ldap format in a text file in the following manner dn: uid=rajendrat, ou=PUNE,dc= shapoorji, dc=com uid: rajendrat objectClass: top objectClass: person objectClass: inetOrgPerson ou: PUNE givenName: RAJENDRA sn: TEKADE cn: PUN/PROJ/RAJENDRA TEKADE mail: rajendra.tekade@ shapoorji. com structuralObjectCla ss: inetOrgPerson entryUUID: 9025a420-5246- 1029-867e- d0bf6fd95702 creatorsName: cn=root,dc=shapoorj i,dc=com createTimestamp: 20050506064813Z entryCSN: 20050506064813Z# 000007#00# 000000 modifiersName: cn=root,dc=shapoorj i,dc=com modifyTimestamp: 20050506064813Z dn: uid=abharsora, ou=Mumbai_ RO,dc=shapoorji, dc=com uid: abharsora objectClass: top objectClass: person objectClass: inetOrgPerson ou: Mumbai_RO givenName: A B sn: HARSORA cn: MUM/PROJ/A B HARSORA mail: abhars...@shapoorji .com structuralObjectCla ss: inetOrgPerson entryUUID: d2ce9ba0-5247- 1029-89e6- d0bf6fd95702 creatorsName: cn=root,dc=shapoorj i,dc=com createTimestamp: 20050506065715Z entryCSN: 20050506065715Z# 000001#00# 000000 modifiersName: cn=root,dc=shapoorj i,dc=com modifyTimestamp: 20050506065715Z dn: uid=kiran.pandhe, ou=PUNE,dc= shapoorji, dc=com uid: kiran.pandhe objectClass: top objectClass: person objectClass: inetOrgPerson ou: PUNE givenName: KIRAN sn: PANDHE cn: PUN/PROJ/KIRAN PANDHE mail: kiran.pandhe@ shapoorji. com structuralObjectCla ss: inetOrgPerson entryUUID: 44688328-5632- 1029-8e53- b130c14697bd creatorsName: cn=root,dc=shapoorj i,dc=com createTimestamp: 20050511063301Z entryCSN: 20050511063301Z# 000001#00# 000000 modifiersName: cn=root,dc=shapoorj i,dc=com modifyTimestamp: 20050511063301Z if i want to get the email adress of all the person in a particular region i will do a grep for that region like grep "PUN" filename i will get result like cn: PUN/PROJ/RAJENDRA TEKADE cn: PUN/PROJ/KIRAN PANDHE but my actual email id lies just below the cn any idea to get one line next to search result pattern line in my eaxample Add more friends to your messenger and enjoy! Go to http://messenger. yahoo..com/ invite/ [Non-text portions of this message have been removed] Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ [Non-text portions of this message have been removed]

