Caffeinated Coder
Book an appointment
Lesson 15 · Networking, scripting and internals

Bash scripting

A Bash script is a text file of commands that Bash runs top to bottom, so a job you type every day can run itself. Follow one seven-line script, count.sh, as it runs: the kernel reads the shebang and starts bash, a variable is made, a glob turns *.txt into a list of file names, a for loop walks that list while arithmetic counts, echo prints each result, and the script ends with an exit status.

11 min9 steps5 questionsAdvanced
Fig 15 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.