Nguyễn Tiến Dũng
New member
How do you do a while loop in bash?
Answer
In bash, while loops are written like this:
Answer
In bash, while loops are written like this:
- while [condition] do [run commands] done.
- while [[ $found == false ]] do echo “Insert your password.” read password done.
- if [[ $password == “test” ]]; then echo “You’ve entered the correct password.” found=true else echo “Your password is incorrect.” fi.