Bird
0
0

What is the effect of the continue command inside a bash loop?

easy🧠 Conceptual Q1 of 15
Bash Scripting - Loops
What is the effect of the continue command inside a bash loop?
AIt skips the rest of the current loop iteration and moves to the next iteration
BIt exits the entire loop immediately
CIt pauses the loop until user input is received
DIt restarts the loop from the first iteration
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of continue in loops

    The continue command tells the loop to skip the remaining commands in the current iteration.
  2. Step 2: Identify what happens after continue

    After skipping, the loop moves to the next iteration immediately without executing further commands in the current one.
  3. Final Answer:

    It skips the rest of the current loop iteration and moves to the next iteration -> Option A
  4. Quick Check:

    continue skips current iteration = D [OK]
Quick Trick: Continue skips current iteration, break exits loop [OK]
Common Mistakes:
MISTAKES
  • Confusing continue with break
  • Thinking continue exits the loop
  • Assuming continue restarts the loop

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes