#!/bin/ksh ## ## SCRIPT: groupids ## ## Where: in $FEDIR/scripts where $FEDIR=/apps/nns_com/fea ## ############################################################################## ## PURPOSE: Shows groups on this network, sorted by groupid. ## Uses 'ypcat passwd' list. ## ############################################################################## ## CALLED BY: feamain -> feautils.menu -> feahelpg.menu script ## and ## feamain -> feautils.menu -> who_ps.menu script ## in $FEDIR/scripts ############################################################################## ## MAINTENANCE HISTORY: ## Written by: Blaise Montandon C61 1Aug1996 ## Updated by: Blaise Montandon O06 23Aug1999 Chgd HOME/temp.lis to OUTLIST, ## set by set_localoutlist; fix ## 'fold -80' -> 'fold -w90'. ## Updated by: Blaise Montandon O06 16Nov2000 Further improved formatting; moved ## 'Command used' to bottom of report. ## Updated by: Blaise Montandon 28jul2003 Updated trailer info in the report ## file. ############################################################################## if test "$FEDIR" = "" then FEDIR=/apps/nns_com/fea fi ############################################################################## ## PREPARE OUTPUT/LIST FILENAME in $OUTLIST. ############################################################################## . $FEDIR/scripts/set_localoutlist ############################################################################## ## PREPARE REPORT HEADING. ############################################################################## THISHOST=`hostname` echo "\ ***************************** `date '+%Y %b %d %a %T%p %Z'` ***************** Login-Groups on the SGI network (Sorted by group-id) Run on Host $THISHOST .............................................................................. Group Group-id Num Users in the Group ---------- ------ -------------------------------------------- " > $OUTLIST ############################################################################# ## PREP REPORT CONTENTS. ############################################################################# ypcat group | sort -k1 | \ awk -F: '{printf("%-10s %6s %s\n\n", $1, $3, $4)}' | \ fold -w78 >> $OUTLIST ############################################################################# ## ADD A TRAILER TO THE REPORT. ############################################################################# echo " ----------------------------------------------------------------------------- The list above was generated by script $0 Command used: ypcat group | sort -k1 | \\ awk -F: '{printf(\"%-10s %6s %s\\\n\\\n\", \$1, \$3, \$4)}' | \\ fold -w78 This report can be generated via site SGI toolchests-drawers: SGI Toolchest -> HandyTools -> sgi-People Tools -> SGIgroups BY groupname or SGI Toolchest -> HandyTools -> Mail (& Web) Tools -> nns SGI-USER Queries & Lists -> SGIgroups BY groupname ----------------------------------------------------------------------------- " >> $OUTLIST ############################################################################# ## SHOW REPORT FILE. ############################################################################# # . $FEDIR/scripts/shofil $OUTLIST (may fail to pass $1 if not down a shell) $FEDIR/scripts/shofil $OUTLIST