awk and shell question (really yp passwd manipulation)

Glenn R. Stone gs26 at prism.gatech.EDU
Wed Sep 20 11:26:56 AEST 1989


In article <2130 at munnari.oz.au> ok at cs.mu.oz.au (Richard O'Keefe) writes:
>In article <2412 at netcom.UUCP>, hinton at netcom.UUCP (Greg Hinton) writes:
>: In article <1163 at ispi.UUCP> jbayer at 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 at prism.gatech.edu, CCASTGS at GITNVE2.BITNET, ...!gatech!gitpyr!ccastgs
Box 30372, Atlanta, GA 30332
"We know it's impossible, now how's the best way to do it?"



More information about the Comp.unix.wizards mailing list