Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash if user exists in a group then add

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