Xref: utzoo comp.sys.att:8462 unix-pc.general:4496 Path: utzoo!utgpu!watserv1!watmath!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!mstar!crappie!karl From: karl@MorningStar.Com (Karl Fox) Newsgroups: comp.sys.att,unix-pc.general Subject: Re: Uniquely identifying a user: is it possible? Message-ID: Date: 13 Jan 90 15:47:31 GMT References: <25730@cup.portal.com> <1143@utoday.UUCP> <25845@cup.portal.com> Sender: usenet@crappie.MorningStar.Com Reply-To: karl@MorningStar.Com (Karl Fox) Organization: Morning Star Technologies Lines: 31 In-Reply-To: thad@cup.portal.com's message of 12 Jan 90 10:18:06 GMT My UNIX-PC (3.51+Development) *does* have getpgrp(). I tried this quick hack and haven't been able to make it fail yet. It works while su'd, nohup'ed and totally redirected. # include # include # define SO "\033[7m" # define SE "\033[m" main() { extern struct utmp *getutent(); register int pgrp = getpgrp(); register struct utmp *up; while (up = getutent()) printf("%s%8s %4s %12s %5d %d %d/%d%s\n", pgrp == up -> ut_pid ? SO : "", up -> ut_user, up -> ut_id, up -> ut_line, up -> ut_pid, up -> ut_type, up -> ut_exit.e_termination, up -> ut_exit.e_exit, pgrp == up -> ut_pid ? SE : ""); } -- Karl Fox, Morning Star Technologies karl@MorningStar.Com