#! /bin/sh
group=""
#utility functions
is_duplicate () {
return grep $1 /etc/passwd /etc/group
}
#script
echo "Welcome to the user management system."
echo "Please enter the name of the group you wish to create:"
read group
while [ is_duplicate "$group" -eq 0 ]
do
echo "That group name already exists."
echo "Please enter a new name:"
read group
done
#! /bin/sh
group=""
#utility functions
is_duplicate () {
return grep $1 /etc/passwd /etc/group
}
#script
echo "Welcome to the user management system."
echo "Please enter the name of the group you wish to create:"
read group
while [ is_duplicate "$group" -eq 0 ]
do
echo "That group name already exists."
echo "Please enter a new name:"
read group
done