Lab 2
The lab portion of our class is implemented as weekly assignments.

All of this should be done on SNOWBALL.

Use the script command to make a log of your activities, "script lab2.log"

Use the "date" command.

Make a new sub-directory, called "labs".

Change to that directory. Use the pwd command to verify that you are in the correct directory.

Move the two files from before to this directory. Use "ls -l" to verify that the files are there.

Use the cat utility to create a new file ("cat > testfile"), then type 4 lines, then press CTRL-D to stop. Use the first 4 letters of your first name, and copy (or type) the corresponding lines from the poem below.

Use the "wc" utility to show how many lines are in the file. Then show how many words are in it.

Use "chmod" so that your two files have read and write privileges for you, but not for the group or world. Use "ls -l" to verify that this worked.

What is the poem's author's connecton to computer science? Use "echo" to say your answer.

Type "exit" to stop the script.

The file "lab2.log" will contain control characters that we do not want. An easy way to get rid of them is to use "cat" on the file, then copy the output and paste it into a new file ("lab2.txt"). This way, the new file's contents should look exactly like what you saw on screen. Check the new file, and manually edit it if needed. Keep the original "lab2.log" file for your records. Turn in the text file.

Finally, schedule an appointment with one of the TAs, to demonstrate your assignment. The TA will ask you questions about this work, and may vary it as appropriate. For example, you may be asked to provide the number of lines in one of the other files that you have. Another example: you may be asked to use "chmod" to assign read privileges for the file's group.


She Walks in Beauty
(Lord Byron)

A - She walks in beauty, like the night
B - Of cloudless climes and starry skies;
C - And all that's best of dark and bright
D - Meet in her aspect and her eyes;
E - Thus mellowed to that tender light
F - Which heaven to gaudy day denies.

G - One shade the more, one ray the less,
H - Had half impaired the nameless grace
I - Which waves in every raven tress,
J, K - Or softly lightens o'er her face;
L - Where thoughts serenely sweet express,
M, N - How pure, how dear their dwelling-place.

O, P - And on that cheek, and o'er that brow,
Q, R - So soft, so calm, yet eloquent,
S - The smiles that win, the tints that glow,
T - But tell of days in goodness spent,
U, V, W - A mind at peace with all below,
X, Y, Z - A heart whose love is innocent!