
#	ATT: ident	"sadmin:admin/menu/usermgmt/lsuser	1.3"

#ident	"@(#)sadmin/admin/menu/usermgmt:lsuser	25.1"

#menu# list users in the system
#help#
#help#	Lsuser will list all the users that have been entered into the
#help#	computer using the "adduser" command.  This list is updated
#help#	automatically by "adduser" and "deluser".

#test if yellow page is up
ps -e > /tmp/t1
if grep ypbind /tmp/t1 > /dev/null
then
# if so, is this the yp master server?
	host=`uname -n`					
	master=`ypwhich`
	if test $host = $master; then
		flag=`cat /tmp/t1`
	else
		echo "Must be YP master server to execute lsuser\n"
		rm /tmp/t1
		exit 1
	fi
fi
rm /tmp/t1

echo '
Users currently in the computer:
(press <RETURN> to start printing each time you hear the bell)'
(
	echo 'login name	user name
----------	---------'
sed 's/^\([^:]*\):[^:]*:[^:]*:[^:]*:\([^:]*\):.*/\1	\2/p' /etc/passwd  |
	sort
)  |
	pr -w79 -tp -l20 -e16 -
