- while
- do
- done
while-loop
examples/script/while.sh
#!/bin/bash secret="my password" guess="" while [ "$secret" != "$guess" ] do read -p "What is your secret? " guess done echo "Congratulations, you passed the test"
#!/bin/bash secret="my password" guess="" while [ "$secret" != "$guess" ] do read -p "What is your secret? " guess done echo "Congratulations, you passed the test"