Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!gatech!prism!gs26 From: gs26@prism.gatech.EDU (Glenn R. Stone) Newsgroups: comp.unix.wizards Subject: Re: awk and shell question (really yp passwd manipulation) Summary: DON'T use ypcat when you just want one! Keywords: yp dbm speed efficiency Message-ID: <1940@hydra.gatech.EDU> Date: 20 Sep 89 01:26:56 GMT References: <1163@ispi.UUCP> <2412@netcom.UUCP> <2130@munnari.oz.au> Reply-To: gs26@prism.gatech.EDU (Glenn R. Stone) Organization: when necessary Lines: 22 In article <2130@munnari.oz.au> ok@cs.mu.oz.au (Richard O'Keefe) writes: >In article <2412@netcom.UUCP>, hinton@netcom.UUCP (Greg Hinton) writes: >: In article <1163@ispi.UUCP> jbayer@ispi.UUCP (Jonathan Bayer) writes: >: >I have to get the user id, and then get the user description from >: >/etc/passwd. >Again, watch out for Yellow Pages; if you're using that you have to do > ypcat passwd | grep "^${LOGNAME}" | what-ever-you-want-here Ummm.... I don't think this is the preferred method, especially when yp is dbm-ized... you REALLY don't want do do this if you have a yp like this one, with yppasswd something on the order of the lower half of five figures left of the decimal. Better is ypmatch $LOGNAME passwd | yourprog which lets yp do what it's supposed to, namely, look up a passwd entry quickly and efficiently, no muss, no fuss, you'll be home in time for dinner. Glenn R. Stone gs26@prism.gatech.edu, CCASTGS@GITNVE2.BITNET, ...!gatech!gitpyr!ccastgs Box 30372, Atlanta, GA 30332 "We know it's impossible, now how's the best way to do it?"