initial commit
This commit is contained in:
28
chapter6/search_group_id.bash
Executable file
28
chapter6/search_group_id.bash
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# SCRIPT: search_group_id.bash
|
||||
# AUTHOR: Randy Michael
|
||||
# DATE: 14/4/2007
|
||||
# REV: 1.0
|
||||
# PURPOSE: This script is used to list the group(s) associated
|
||||
# with each user defined in the /etc/passwd file.
|
||||
#
|
||||
#
|
||||
###########################################
|
||||
# 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
|
||||
Reference in New Issue
Block a user