© Daniel Platt 2021
D. PlattTweak Your Mac Terminalhttps://doi.org/10.1007/978-1-4842-6171-2_5

5. Shell Scripting Basics

Daniel Platt1  
(1)
Andover, Hampshire, UK
 

Some of my earlier memories of using computers involve typing a computer program into the computer. I remember hoping that I didn’t make a mistake and then finally running it. In this chapter, I hope to foster a sense of accomplishment that helps you on your journey.

We have been using Zsh as our shell in all the examples so far in this book. However, there is another shell we will use for scripting, called sh.

Unlike Zsh, sh has been bundled with macOS for many years and is a good default for maximum compatibility with any script you write. This is especially important if you want to use ...

Get Tweak Your Mac Terminal: Command Line macOS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.