#! /bin/sh #---------------------------------------------------------------------------- # show-user-additional-group - show additional groups of user # # Copyright (c) 2003 Frank Meyer # # Creation: 20.07.2003 fm # Last Update: 20.07.2003 fm # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- clrhome colecho "Show additional groups of user" gn echo tty=`tty` echo echo echo -e "User: \c" read user IFS=':' if [ "$user" != "" ] then echo line=`grep "^$user:" /etc/passwd` if [ "$line" != "" ] then echo " Additional groups of user $user:" echo IFS=':' while read line do set -- $line g="$1" u="$4" IFS=',' set -- $u for j in $* do if [ $j = $user ] then echo " $g" break fi done IFS=':' done