Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash if user exists in a group then add

egrep -i "^groupname" /etc/group;
if [ $? -eq 0 ]; then
   echo "Group Exists"
else
   echo "Group does not exist -- Invalid Group name"
fi
Source by bytefreaks.net #
 
PREVIOUS NEXT
Tagged: #bash #user #exists #group #add
ADD COMMENT
Topic
Name
5+7 =