Bash Scripting - Loops
What will be the output of this bash script?
for i in 1 2 3 4 5; do
if [ "$i" -eq 3 ]; then
break
fi
echo $i
donefor i in 1 2 3 4 5; do
if [ "$i" -eq 3 ]; then
break
fi
echo $i
donei equals 3, the break command stops the loop immediately.i is 3, loop breaks, so 3 is not printed.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions