Skip to content
Snippets Groups Projects
Commit e42c87e3 authored by iliya.saroukha's avatar iliya.saroukha
Browse files

finished groups script

parent 9ff72a62
No related branches found
No related tags found
No related merge requests found
......@@ -9,24 +9,20 @@ function get_groups() {
main_group=$(cat /etc/group | grep $1 | cut -d : -f 1)
all_groups=$(cat /etc/group | grep $main_group)
# echo $other_groups
# echo $all_groups
# echo $group_contents
echo $main_group
# echo $main_group | cut -d : -f 1
for group in $all_groups; do
# echo $group
group=$(echo $group| cut -d : -f 1)
echo $group $main_group
if ["$main_group" != "$group"]; then
echo "WESH"
if [ "$group" != $main_group ]; then
echo $group
fi
done
}
if [ $# -eq 0 ]; then
echo "Usage:"
echo " ./get-groups.sh username"
......@@ -40,8 +36,6 @@ if [ "$user" = "" ]; then
exit 1
else
user_gid=$(get_gid $user)
# echo $user_gid
# echo $user
echo $(get_groups $user_gid)
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment