Path: utzoo!mnetor!uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!ssc-vax!uvicctr!tholm From: tholm@uvicctr.UUCP (Terrence W. Holm) Newsgroups: comp.os.minix Subject: whoami(1) Message-ID: <398@uvicctr.UUCP> Date: 5 May 88 06:50:11 GMT Reply-To: tholm@uvicctr.UUCP (Terrence W. Holm) Organization: University of Victoria, Victoria B.C. Canada Lines: 69 EFTH Minix report #5 - May 1988 - whoami(1) This is an implementation of whoami(1) that we wrote for Minix. Please consider this a public domain program. A "man" page is included. echo x - whoami.1 gres '^X' '' > whoami.1 << '/' XNAME X whoami(1) - who is the current effective user X XSYNOPSIS X whoami X XDESCRIPTION X The current effective user name is written to the X standard output stream. X XSEE ALSO X cuserid(3) / echo x - whoami.c gres '^X' '' > whoami.c << '/' X/****************************************************************/ X/* */ X/* whoami(1) */ X/* */ X/* The login name of the current effective user */ X/* is written to the standard output stream. */ X/* */ X/****************************************************************/ X/* origination 1987-Sep-24 T. Holm */ X/****************************************************************/ X X X#include X#include X X Xstruct passwd *getpwuid(); X X X Xmain() X { X struct passwd *pw_entry; X X pw_entry = getpwuid( geteuid() ); X X if ( pw_entry == NULL ) X exit( 1 ); X X puts( pw_entry->pw_name ); X X exit( 0 ); X } / -------------------------------------------------------------------- Edwin L. Froese uw-beaver!ubc-vision!mprg!handel!froese Terrence W. Holm uw-beaver!uvicctr!sirius!tholm