Exam #2 -- 15 November, 1994

This is an open book, open notes exam. You may use the Unix workstations, but no email! Turn in the exam by 7:30 PM. Note, that's not 8:30 PM!

Problem 1. (5 points)

How do you iconify a window under X windows?

Problem 2. (5 points)

What's the easiest way to repeat the last command using the C shell's history mechanism?

Problem 3. (5 points)

Suppose you just typed the command

Show how you can use the history mechanism of the C shell to easily execute the command

Problem 4. (5 points)

Which shell commands maintain a "stack" of directories?

Problem 5. (5 points)

What does the shell operator $$ do?

Problem 6. (5 points)

What is file name completion?

Problem 7. (5 points)

What is a quick way to tell if you are typing commands to a Bourne shell or a C shell?

Problem 8. (5 points)

What's the easy way to insert 97 x's into your buffer when using emacs?

Problem 9. (5 points)

How do you leave insert mode in vi?

Problem 10. (5 points)

How do you open a file in emacs?

Preface to problems 10 and 11

The last command shows the times people are logged into the computer. Before proceeding with this exam read the man page for the last command and type

to get some idea of what the last command does.

Problem 11. (10 points)

Write a C shell script that displays the last ten times you were logged into your present workstation.

Problem 12. (20 points)

Write a C shell script that calculates the number of minutes you were logged into your present workstation on your last complete (login and logout) session. Your program should work even if you were logged into the system more than one whole day.

Problem 13. (20 points)

Write a C shell script that takes a Unix pathname as an argument. The shell script then prints a message that states if the pathname is a directory or not. For example, typing

should result in the message

while typing

should result in the message

Back to the Handout index