Oct 15, 2019 02:50 PM
(This post was last modified: Oct 15, 2019 02:51 PM by friiz1337.)
Hey guys, I'm trying to figure out how to break out of a loop when the user types the correct username. For now my loop continues to give me the same "Try again" output even when the condition is correct. I tried with 2 loops but it didn't work. Any ideas?
When username is correct the first time:
When username is correct the 2nd time:
Code
if [ "$userResult" == 1 ]
then
echo Enter password:
read password
else
echo Wrong username. Try again:
read username
while [ "$userResult" == 0 ]
do
echo try again:
read username
done
fiCode
Enter Username
BOBO
Enter password:Code
Enter Username
B
Wrong username. Try again:
BOBO
try again:
