Everyone:
Next week, we will review for the upcoming Exam 01, which will cover everything from utilizing git, using the shell, scripting the shell, constructing pipelines with filters, and wielding regular expressions.
Because of the exam on Wednesday, February 13, there will be no homework for the upcoming week.
The focus of this reading is to review for the upcoming Exam 01.
The readings for this week are:
This is a non-exhaustive though mostly complete overview of the terms, concepts, and skills should know for the upcoming exam.
On Friday, we will begin our transition to Python. If you wish to get ahead on snake wrangling, you may wish to begin reading the following:
Scipy Lecture Notes: 1.2. The Python language
This provides a brief overview of the Python programming language.
If you wish for more in-depth material about Python, you can also reference the following resources:
This week, your reading quiz is split into two sections: the first part is your normal dredd quiz, while the second part involves a series of pipelines. The questions are based heavily on Checklist 01.
Record the answers to the following Reading 04 Quiz questions in your
reading04
branch:
For the second part, given the following data about the Teenage Mutant Ninja Turtles:
Leonardo:blue:katana Donatello:purple:bo Raphael:red:sai Michelangelo:orange:nunchucks
You are to complete the following pipelines:
List only the names of the turtles in sorted order.
$ curl -sLk https://yld.me/raw/lE8 | ... Donatello Leonardo Michelangelo Raphael
List only the colors of the turtles in all capitals.
$ curl -sLk https://yld.me/raw/lE8 | ... BLUE PURPLE RED ORANGE
Replace all weapons with plowshares
$ curl -sLk https://yld.me/raw/lE8 | ... Leonardo:blue:plowshare Donatello:purple:plowshare Raphael:red:plowshare Michelangelo:orange:plowshare
List only the turtles whose names end in lo
.
$ curl -sLk https://yld.me/raw/lE8 | ... Donatello Michelangelo
List only the turtles with names that have two consecutive vowels.
$ curl -sLk https://yld.me/raw/lE8 | ... Leonardo Raphael
Count how many colors don't begin with a vowel
$ curl -sLk https://yld.me/raw/lE8 | ...
3
List only the turtles names whose name ends with a vowel and whose weapon ends with a vowel.
$ curl -sLk https://yld.me/raw/lE8 | ... Leonardo Donatello
List only the colors of the turtles whose name has two of the same
consecutive letter (i.e. aa
, bb
, etc.)
$ curl -sLk https://yld.me/raw/lE8 | ... purple
To record your pipelines, you will need to write your answers to the filters.sh script:
# Download filters template
$ curl -LOk https://gitlab.com/nd-cse-20289-sp19/cse-20289-sp19-assignments/raw/master/reading04/filters.sh
Each question has a corresponding function; for instance, the solution for
Question 1 should be recorded in q1_answer
:
#!/bin/bash q1_answer() { # TODO: List only the names of the turtles in sorted order. curl -sLk https://yld.me/raw/lE8 | ... }
To construct your pipelines, you should try them interactively in your shell. Once you found a reasonable solution, you can record them in the filters.sh script under the appropriate function.
To test your pipelines, you need to download the Reading 04 Makefile, which in turn will download the test_filters.sh test script and execute it:
# Download Makefile $ curl -LOk https://gitlab.com/nd-cse-20289-sp19/cse-20289-sp19-assignments/raw/master/reading04/Makefile # Download test scripts and run test $ make ... # Test your filters $ ./test_filters.sh Testing filters.sh ... Q1 Success Q2 Success Q3 Success Q4 Success Q5 Success Q6 Success Q7 Success Q8 Success Score 1.00
To submit you 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 GitLab $ git checkout -b reading04 # Create reading04 branch and check it out $ cd reading04 # Go into reading04 folder $ $EDITOR answers.json # Edit your answers.json file $ ../.scripts/submit.py # Check reading04 quiz Submitting reading04 assignment ... Submitting reading04 quiz ... Submitting reading04 quiz ... Q1 0.40 Q2 0.40 Q3 0.40 Q4 0.40 Q5 0.30 Q6 0.30 Q7 0.40 Q8 0.40 Score 3.00 $ git add answers.json # Add answers.json to staging area $ git commit -m "Reading 04: Quiz" # Commit work $ $EDITOR filters.sh # Edit your filters.sh file $ ./test_filters.sh # Test your filters Testing filters.sh ... Q1 Success Q2 Success Q3 Success Q4 Success Q5 Success Q6 Success Q7 Success Q8 Success Score 1.00 $ git add Makefile # Add Makefile to staging area $ git add filters.sh # Add filters.sh to staging area $ git commit -m "Reading 04: Filters" # Commit work $ git push -u origin reading04 # Push branch to GitLab
Remember to create a merge request and assign the appropriate TA from the Reading 04 TA List.