Next week, we will explore some basic networking utilities and then begin learning about shell scripting. That is, we will go from interactively controlling the Unix shell to utilizing the shell as a full-fledged programming language with variables, conditional statements, loops and even functions.
The readings for next week are:
The Linux Command Line (Tools):
Chapter 17 - Searching For Files
The Linux Command Line (Scripting):
Chapter 33 - Flow Control: Looping With For
For a shorter version of the scripting chapters, you can read Writing Shell Scripts instead. However, the chapters above are listed to serve as a reference should you need them (they do a more thorough job of explaining the material).
The following are additional resources that you may find useful:
A tool that will be demonstrated in class, but not assessed in the reading quiz or homework is tmux, which is one of the most game-changing programs you could ever learn:
Although not required, it is highly recommended that you learn how to use tmux.
Try out the following commands at your own discretion:
$ nc towel.blinkenlights.nl 23
Once you have completed the readings, answer the following Reading 02 Quiz questions:
To verify the correctness of your
exists.sh script, you should be able to
reproduce the following:
$ ls -l # List files in reading02 directory total 8.0K -rw-r--r-- 1 pbui pbui 23 Jan 18 15:39 README.md -rw-r--r-- 1 pbui pbui 144 Jan 28 13:37 answers.json -rwxr-xr-x 1 pbui pbui 254 Jan 28 18:02 exists.sh $ ./exists.sh * && echo Success # Run script and check error code answers.json exists! exists.sh exists! README.md exists! Success $ ./exists.sh * ASDF || echo Success # Run script and check error code answers.json exists! exists.sh exists! README.md exists! ASDF does not exist! Success
To submit your work, follow the same process outlined in Reading 01:
$ git checkout master # Make sure we are in master branch $ git pull --rebase # Make sure we are up-to-date with GitHub $ git checkout -b reading02 # Create reading02 branch and check it out $ cd reading02 # Go into reading02 folder $ $EDITOR answers.json # Edit your answers.json file $ ../.scripts/check.py # Check reading02 quiz Checking reading02 quiz ... Q1 1.00 Q2 0.50 Q3 0.40 Q4 0.30 Q5 1.80 Score 4.00 / 4.00 Status Success $ git add answers.json # Add answers.json to staging area $ git commit -m "Reading 02: Done" # Commit work $ git push -u origin reading02 # Push branch to GitHub
Remember to create a Pull Request and assign the appropriate TA from the Reading 02 TA List.
DO NOT MERGE your own Pull Request. The TAs use open Pull Requests to keep track of which assignments to grade. Closing them yourself will cause a delay in grading and confuse the TAs.