thanx for thhat quick reply but i want email id's of say pune region not all region if i use the command #grep mail yourfilename -r it will shaow all email id not categerly pune email id
--- On Wed, 17/12/08, Gourav Joshi <[email protected]> wrote: From: Gourav Joshi <[email protected]> Subject: Re: [LinuxVadaPav] advanced search script required To: [email protected] Date: Wednesday, 17 December, 2008, 6:06 PM On Wed, Dec 17, 2008 at 5:36 PM, ashok abraham <ashok...@yahoo. com> wrote: > 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 <rajendra.tekade% 40shapoorji. 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 <abharsora%40shapoo rji.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 <kiran.pandhe% 40shapoorji. 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/ > > > Hi, Instead of grep PUN you should grep mail like this; #grep mail yourfilename -r it will give u result like this mail: rajendra.tekade@ shapoorji. com mail: abhars...@shapoorji .com mail: kiran.pandhe@ shapoorji. com -- Have a nice time, Gourav Joshi [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]
