Automation, Orchestration, and Scripting
What does this loop print? i=1; until [ $i -ge 4 ]; do echo $i; i=$((i+1)); done
Show the answer
Correct answerA. 1, 2 and 3, each on its own line
The until loop runs while [ $i -ge 4 ] is false, so it prints 1, 2 and 3 and stops once i reaches 4. Printing 4 would need the test -gt 4, since -ge 4 is already true at that point.