To access a Unix "shell prompt" on macOS, you need to use the Terminal application that is in your Mac's Applications/Utilities folder:

00-TerminalApp

Unless you are running an older version of macOS, when you launch the Terminal app you will see a prompt that looks like this (though probably with a smaller font, white background and black text):


01-ZSHbyDefault


In the window above, I've entered a command that shows us what processes are running for my user. Don't worry if you don't understand it; we'll cover this command during the semester! However, it does show that modern Macs run a shell called "zsh" (Z-shell) by default instead of bash. macOS does ship with a bash shell, but it is an old one (v3.2.x) and some of the scripting we will do this semester requires bash 4.0 or later. These instructions will walk you through the easiest way to update your Mac to have a newer bash shell available.

The first thing you will need to do is install a package manager called "HomeBrew" (if you don't have it installed already). Begin by going to the HomeBrew site:


02-GetHomeBrew


Then, copy the command shown above to your clipboard and paste it into a terminal window:


03-CopyToTerminal


Hit return, and the HomeBrew installation process will begin. You will be asked for a password; you should use the password you log into your Mac with:



04-EnterPassword


Once your password is accepted, you will be asked to hit RETURN to start the install:


05-HitRETURNtoStartInstall



Once the HomeBrew install is complete, you will see the following:


06-BrewInstalled


You can verify that the "brew" command was properly installed by doing the following:


07-VerifyBrew


Assuming "brew" is properly installed, you may proceed by asking brew to update your older bash shell:


08-InstallNewerBash



Once the install of the newer bash is complete, you should be able to type the command "bash" to run a bash shell. You can also type the command shown below to verify the version of the bash shell:


09-RunNewBash



Once you have verified that you can run a bash shell that is v4.0 or greater, you are ready for class!