Not sure if this is my problem yet but when the author wrote this book, which is very good by the way, the default shell of OS X was forever and always ‘bash’. The default shell for any user account in macOS Catalina 10.15.x is ‘zsh’ which is different from ANYTHING it’s been for decades.
If you go into System Preferences → Users & Groups and ‘right click’ on your account name you will see ‘Advanced Options’.
Notice the RED warning.
This is where you can easily change your shell preference. I would strongly suggest you set it to ‘bash’ while you are working thru this book.
Happy coding!