Which command in a shell script is used to break out of a loop prematurely?

  • break
  • continue
  • exit
  • return
The break command in a shell script is used to break out of a loop prematurely. When encountered, it immediately exits the loop and continues with the next statement after the loop. This is handy for situations where you want to exit a loop based on a specific condition.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *