1. [2] Open a new bash shell
bash2. [8] Create a new directory and make it current for the following steps.
This turned out to be harder to detect in your output than I expected.
mkdir TestDir; cd TestDir3. [25] In a single command line, count the number of times the 1st of a month fell on Saturday (hint look for more than two spaces after the single numeral 1) in the year 2000.
[4] [4]
cal 2000 | grep " 1 " | wc -l4. [25] In one command line, create in your new directory a new text file consisting of all the files (user names) in the directory "/users/students" with two consecutive vowels in their user names, and sorted reverse alphabetically.
[4] [5] [5] [5] [5] [2]
Note that grep produces one line of output for every line of its input containing a string matching the pattern, so wc can just count lines. There are no months in 2000 where the 1st fell on a Saturday at the end of a line.
ls /users/students/ | grep "[aeiou][aeiou]" | sort -r > afile5. [10] Open this file in a (unix) text editor such as vi or emacs, and globally change all the letters "s" in the file to "SOS".
[5] [3] [4] [4] [5] [4]
Although it's not obvious, ls sends file names one per line when piped to another command. Thus grep can just pick out the lines with consecutive vowels and send them to sort.
These two steps (5 and 6) don't leave any particular trace in the history, but I expected to see in the printout that you succeeded.6. [10] Move the last line to the top of the file. Insert in front of it your own name followed by a blank line, then save the file.
7. [15] Using a single command line, add to the end of your text file today's date, followed by a history of the commands you used so far to take this test, and print the result.
date >> afile; history >> afile; lpr afile8. [5] Turn in your printed output. If you make too many mistakes, you may need to start over so the printed history has all your commands.
[5] [5] [5]
First draft 2004 March 10
Scoring added March 12