Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!murtoa.cs.mu.oz.au!munnari.oz.au!cs.mu.oz.au!ok From: ok@cs.mu.oz.au (Richard O'Keefe) Newsgroups: comp.unix.wizards Subject: Re: YP answer (was Re: awk and shell question) Keywords: awk sh Message-ID: <2139@munnari.oz.au> Date: 19 Sep 89 09:45:29 GMT References: <1163@ispi.UUCP> <2412@netcom.UUCP> <2130@munnari.oz.au> <124894@sun.Eng.Sun.COM> Sender: news@cs.mu.oz.au Lines: 14 In article <124894@sun.Eng.Sun.COM>, limes@ouroborous.Eng.Sun.COM (MIDI Apprentice) writes: : In article <2130@munnari.oz.au> ok@cs.mu.oz.au (Richard O'Keefe) writes: : >Again, watch out for Yellow Pages; if you're using that you have to do : > ypcat passwd | grep "^${LOGNAME}" | what-ever-you-want-here : Assuming that a YP lookup operation is more efficient then doing a YP : database dump and grovelling through it with grep, the following will : probably be somewhat faster (my passwd map is around 2500 entries): : ypmatch $LOGNAME passwd | cut -f5 -d: My point was to _beware_ of Yellow Pages. The manual page says of ypmatch that "No pattern matching is available". If you're looking for an exact match, ypmatch is fine. For anything else, ypcat | grep is the way to go.