Bash Scripting - Loops
Find the error in this script:
i=0
while [ $i -lt 5 ]
do
i=$((i+1))
if [ $i -eq 3 ]; then
break
fi
echo $i
donei=0
while [ $i -lt 5 ]
do
i=$((i+1))
if [ $i -eq 3 ]; then
break
fi
echo $i
donewhile condition must end with a semicolon or newline before do.while [ $i -lt 5 ] is not followed by a semicolon or newline before do, causing syntax error.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions