Created
November 23, 2012 13:04
-
-
Save scicco/4135531 to your computer and use it in GitHub Desktop.
List all users for each group with members command
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 | |
# Version: 0.1 | |
# Description: This script has a dependancy with members package | |
# Tested only on Ubuntu | |
# | |
# todo: | |
# - test members package existance with which output | |
# - get rid of members dependancy | |
if [ -x /usr/bin/members ]; then | |
for GROUP_NAME in `groups` | |
do | |
echo "Group: $GROUP_NAME" | |
echo "Users found: `members $GROUP_NAME`" | |
done | |
else | |
echo "/usr/bin/members not found" | |
echo "please install members package with: sudo apt-get install members" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment