hw06: Reading about pipes
- Due before the beginning of class on Monday, January 23
Today’s homework asks you to do a few different things, and then fill in another wonderful markdown file to show what you’ve done.
Sign up for the info challenge.
As we mentioned in class, every SD212 student will be participating in the UMD/USNA Info Challenge, which is a (hopefully) fun and useful way to connect our data science skills to real-world datasets and to work with external mentors.
Note that you will all be assigned to teams within SD212, after signing up.
Fill in the Google form to sign up if you haven’t already.
Answer “yes” to this problem to indicate that you’ve completed and submitted that form.
(Optional) Install some extra command-line tools in WSL
Most of the command line tools we are using come pre-installed with every version of Linux. But a few are not. They are available on the lab machines and csmidn, but if you want them on your laptop too, then open a WSL/Ubuntu terminal and run these commands. (When you are asked, enter your WSL/Ubuntu password that you chose):
sudo apt update sudo apt install -y jq moreutils bsdmainutils bat tree cowsay csvkit tldr mlocate aspell bc diction groff
Read TLCL Chapter 6 “Redirection”
Answer “yes” to indicate that you did the reading.
What is “standard error”?
- An error message indicating a program does not work properly
- A special location (default goes to the screen) where status messages are printed
- A file in the directory
/var/log
where a program’s error messages are stored - A terminal that is used for debugging when a program crashes
Assume
congress.txt
is a file that contains information on elected representatives likefirstname,lastname,state,party
What would the following pipeline do?
cat congress.txt | cut -d',' -f3 | sort | uniq | wc -l
- Get the number of different states in the file
- Get the number of felines that have been elected to office
- Print out all party affiliations in sorted order
- Show how many members of each party are represented
Submit command
To submit files for this homework, run one of these commands:
submit -c=sd212 -p=hw06 hw06.md
club -csd212 -phw06 hw06.md
Download the file hw06.md to fill in and submit for this homework