hw06: Reading about pipes
- Due before the beginning of class on Monday, January 22
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.
(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 ssh.cs, 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”
Note that this reading should be largely reviewing and reinforcing what we already covered in class, rather than introducing new concepts. So you should read carefully and expect to understand it completely.
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