#!/bin/ksh ## ## SCRIPT: userids ## ## Where: in $FEDIR/scripts where $FEDIR=/apps/nns_com/fea ## ############################################################################# ## PURPOSE: Shows users on this network, sorted by userid. ## Uses 'ypcat passwd' list. ## ############################################################################# ## CALLED BY: peopletools in $FEDIR/scripts ## actually, by peopletools.chestdef in $FEDIR/scripts. ## ## and originally by ## feamain -> feautils.menu -> feahelpg.menu script ## in $FEDIR/scripts. ############################################################################# ## MAINTENANCE HISTORY: ## Written by: B. Montandon 25Apr1995 ## Updated by: B. Montandon 16Jan1997 Used awk to improve formatting. ## Updated by: B. Montandon 16Nov2000 Further improved formatting; moved ## 'Command used' to bottom of report. ## Updated by: B. Montandon 19sep2002 Add comment on using the 'ShowAllMatches' ## button of the 'xpg' GUI to extract ## subsets of lines, like for search string ## 'e12' --- to show dept E12 SGI userids. ############################################################################# ## FOR TESTING: # set -x # . $FEDIR/scripts/clearnns if test "$FEDIR" = "" then FEDIR=/apps/nns_com/fea fi ############################################################################# ## SET TEMP-LIST-FILENAME IN $OUTLIST. ############################################################################# . $FEDIR/scripts/set_localoutlist ############################################################################# ## PREP REPORT HEADING. ############################################################################# THISHOST=`hostname` echo "\ ***************************** `date '+%Y %b %d %a %T%p %Z'` ***************** User IDs (and user names) on the SGI network (SORTED BY USER-ID) Run on Host $THISHOST ........................................................................................ Note: The 'Dept' is that used when the userid was first entered in the password file. The depts of some users have changed. ........................................................................................ User Group 'Original' UserID Num Num User Name , Dept HomeDirectory LoginShell --------- ------ ------ ------------------------ ------------------------- ---------- " > $OUTLIST ############################################################################# ## PREP REPORT CONTENTS. ############################################################################# # ypcat passwd | sort -t: +0 -n | cut -d: -f1,3,4,5,6,7 >> $OUTLIST # ypcat passwd | sort -t: +0 -n | awk -F: \ ypcat passwd | sort -t: -k1 -n | awk -F: \ '{printf "%-9s %6s %6s %-25s %-25s %s\n", $1 , $3 , $4, $5 , $6 , $7}' \ >> $OUTLIST ############################################################################# ## ADD A TRAILER TO THE REPORT. ############################################################################# echo " ----------------------------------------------------------------------------- The list above was generated by script $0 You can use the 'Show All Matches' button of the 'xpg' GUI to extract subsets of lines. Example: for search string 'e12' --- and for N = 0 lines (plus-and-minus the match lines) --- the 'Show All Matches' button will show dept E12 SGI userids. ------------ This utility is available via the 'sgi-People Tools' or 'Mail (& Web) tools' drawers of the site SGI 'HandyTools' toolchest option. This utility is/was available via the OLD, winterm-based 'nnsFEAmenu' option 'h su' (or 'u h i' or 'u n i' or ' u o i'). ------------ Command used: ypcat passwd | sort -t: -k1 -n | awk -F: \\ '{printf \"%-9s %6s %6s %-25s %-25s %s\\\n\", \$1 , \$3 , \$4, \$5 , \$6 , \$7}' ----------------------------------------------------------------------------- " >> $OUTLIST ############################################################################# ## SHOW REPORT FILE. ############################################################################# # . $FEDIR/scripts/shofil $OUTLIST (fails to pass $1 if not down a shell) $FEDIR/scripts/shofil $OUTLIST