ScriptingLesson 50Free preview
Bash Loops
This lesson is part of Bash · All levels
Summary
The Bash repeat runs the command block many times: for for list or range, while during the correct condition, and until the condition becomes correct. break stops the repeat, while continue directly to the next iteration. Repetition is widely used to process many files in a script.
Key points
- for x in daftar; do ...; done
- While [condition]; do...; done running during right
- Until the condition becomes right
- Break out the repetition, continue on the next iteration
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.