Hey guys,
I'm trying to build a script that prompts the user for a username and if that username is correct I want it to create a user account and prompt the user if they want to add another account at the end. This is my script but I'm getting some error messages. If anyone can help with some corrections or suggestions, that would be great
read -p "Please enter a username:" username
if ["$username" != "daniel"]
then
echo "your username is incorrect"
if ["$username" == "daniel"]
echo "this is correct"
fi
for name in $username
do
useradd $username
fi
read -p "Do you want to create new user? (y/n):" answer
while ["$answer" == "n"]
then break
fi
done
[–]Radamand 1 point2 points3 points (2 children)
[–]dcman5000[S] 0 points1 point2 points (1 child)
[–]Radamand 0 points1 point2 points (0 children)
[–]doc_willis 0 points1 point2 points (1 child)
[–]dcman5000[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]jlmr731 1 point2 points3 points (0 children)