Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hpcea!hpfcdc!hpfclp!diamant From: diamant@hpfclp.HP.COM (John Diamant) Newsgroups: comp.mail.misc Subject: Re: user name in /etc/passwd GCOS field Message-ID: <8120013@hpfclp.HP.COM> Date: 16 Apr 88 20:46:12 GMT References: <1361@lznv.ATT.COM> Organization: HP SDE, Fort Collins, CO Lines: 38 > My group is looking for a standard way that mail(1) can get a user's > name from a password file entry. The proposed solution is to take > everything up to (but not including) the first left or right > parenthesis (or, of course, up the the terminating colon). Some > members of another group in the area have suggested ending before the > first parenthesis, but stripping off everything before (and including) > a hyphen. Either way, a system-wide parameter would control whether > mail would use this legible name. Well, it sounds like what you need here is a standard. As it turns out, there already is a defacto standard for interpretation of the GECOS field on Unix. It's defined by finger (a BSD-ism similar to who). It uses commas as separators. The fields it knows about are: user name, office location, office phone, home phone It ignores any fields after the ones it knows about and sendmail already knows how to pull your user name out of the first field (up to the first comma). So please use this standard and don't invent a new one. By the way, if there are no commas, the entire GECOS field is assumed to be the user name. > How would either of these algorithms work for *your* password file? No, sir, they would not. The problem is that I already run finger and sendmail and I have to use that format, so if you come up with an incompatible format, it would be impossible to satisfy both sets of programs at once. > Would they lose part of your name? No. > Would they still include junk? Yes. > If one or the other was implemented, would you face a major effort to > bring your password file into line? No, but then I couldn't bring it into conformance because it would break my other programs. John Diamant Software Development Environments Hewlett-Packard Co. ARPA Internet: diamant@hpfclp.sde.hp.com Fort Collins, CO UUCP: {hplabs,hpfcla}!hpfclp!diamant