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

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

#menu# list groups in the system
#help#
#help#	Lsgroup will list all the groups that have been entered into
#help#	the computer using the "addgroup" command.  This list is
#help#	updated automatically by "addgroup" and "delgroup".

#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 lsgroup\n"
		rm /tmp/t1
		exit 1
	fi
fi
rm /tmp/t1

echo '
Groups currently in the computer:
(press <RETURN> to start printing each time you hear the bell)'

(echo 'group	group	logins permitted to become
name	number	members using newgrp
-----	------	--------------------------'
sed 's/$/:/
s/^\([^:]*\):[^:]*:\([^:]*\):\([^:]*\)/\1	\2	\3/p
s/:$//' /etc/group |
	sort
)  |
	pr -w79 -tp -l20 -e16 -
