Save this video free

Lecture 13: Loops

Burton Ma · 47:52 · Watch on YouTube

Lecture 13: Loops Watch on YouTube →

Overview

Bash loops use command exit statuses as conditions and include `while`, `until`, for-each, and C-style counting forms. The lecture builds examples including countdowns and a Collatz sequence, then shows how quoting, word splitting, globs, `"$@"`, `shift`, and `read` affect loop inputs. It ends with Bash function syntax and explains that a function's positional parameters are separate from the script's arguments.

Key takeaways

Chapters

0:00 Bash Loop Types and Exit-Status Conditions
6:23 Countdown Loops and the Collatz Conjecture
9:25 Validating Inputs for a Bash Collatz Script
15:51 For-Each Loops, Word Splitting, and Filename Globs
22:53 Brace Expansion, Command Substitution, and Counting Loops
27:00 Preserving Script Arguments with `"$@"` and `shift`
34:03 Reading and Splitting File Lines with `read`
38:23 Declaring and Calling Bash Functions
43:00 Function Arguments and Script Positional Parameters

Keep these chapters and the full searchable transcript in your own library.

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Burton Ma.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.