01 / 08
The same thing, to a great many
The watcher you made last lesson could only look at one file.
~ $ ./watch.sh blue.txt~ $ ./watch.sh red.txt~ $ ./watch.sh yellow.txtThree you can type, but thirty is out of the question.
So you learn repetition.
for F in *.txt; do ./watch.sh "$F"doneThat alone looks at every .txt there is, however many.
With this the three elements of a program are complete.
1. run in order lesson 12. branch on a test lesson 33. repeat todayWith those three you can write most things. In JavaScript or Python you learned the same three. Only the writing differs.
And in fact you are already using something like it.
ls *.txt | xargs wc -lThe xargs of chapter 4. That too is a tool for doing the same thing to a great many. Today you learn the version you can write in.