while-loop
- while
- do
- done
#!/bin/bash
secret="my password"
guess=""
while [ "$secret" != "$guess" ]
do
read -p "What is your secret? " guess
done
echo "Congratulations, you passed the test"
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
#!/bin/bash
secret="my password"
guess=""
while [ "$secret" != "$guess" ]
do
read -p "What is your secret? " guess
done
echo "Congratulations, you passed the test"