Created
February 12, 2013 03:42
-
-
Save hackingbutlegal/4760089 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# List the group(s) associated with each user defined in /etc/passwd | |
# | |
# | |
########################################### | |
# DECLARE FILES AND VARIABLES HERE | |
########################################### | |
case $(uname) in | |
SunOS) alias awk=nawk | |
;; | |
esac | |
######################################### | |
# BEGINNING OF MAIN | |
######################################### | |
cat /etc/passwd | awk -F : '{print $1}' | while read ID | |
do | |
echo -e "${ID}: \c" | |
id -Gn $ID | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment