Weblog (or Blog)
Tuesday, May 07, 2019
My first home computer was a Tandy Radio Shack TRS-80. It used a cassette tape (yep, just like the ones you played music from) to store its programs. When you turned it on, you were presented with a prompt and a blinking cursor, ready for you to type something. I could not find a screenshot of that, but I did find one for the opening screen of the Apple II, which came out the same year, 1977. The TRS-80's prompt was similar because they both used the programming language BASIC as the operating system.
Even when I "graduated" to the IBM PC in 1981, turning it on brought you to an empty screen with only A:\> (designating one of the two floppy disk drives, A and B) and a blinking cursor. This is the command line interface (CLI)--no icons or menus in sight. The computer expects you to type a command to get things started. A program is running in the background to interpret your commands to the operating system and start the computer to doing what you told it to do. Thus CLI is sometimes called command language interpreter. When you are not familiar with the commands, that blinking cursor fosters all sort of anxiety.
In my blog, I talked about my experience with the Windows command line and batch files (Windows version of scripts). I'm exploring how to write scripts to do repetitive tasks on my Macbook Pro. The scripts are a series of commands in a text file that can be run from the CLI prompt by typing the name of the file. The shell for macOS is a program called bash, an abbreviation of "Bourne again shell." So before I can write a script consisting of commands, I need to know what those commands are and how to use them. The best resource I have found on the Internet is Zed Shaw's Command Line Crash Course. So if you are interested in learning along with me, go through that tutorial and then we will proceed to scripting the commands.