Homework #4

Due: 6:00 PM, 27 October, 1994

Write C shell scripts to solve the following problems:

Problem 1

Write a C shell script that takes an integer as an argument and multiples the integer by 17.

Problem 2

Write a script that prints the last 200 processes you have executed.

Problem 3

Write a shell script that anyone can run by typing something like

itshot 82

which will record in a file the script's argument, the time (obtained from date), and the name of the person making the observation (obtained from whoami). To get complete credit on this problem, you need to do some error handling.

Problem 4

Write a user-friendly shell to tar and compress directories. Your program should prompt the user for the name of a directory to be tared and compressed and the name of a file in which to store the result. Of course, you will have lots of error checking!

Problem 5

Write a shell script that prints out how many blocks you can use before you exceed your quota. If the person running the script has already exceed their quota, print out a warning message.

Problem 6

When you are finished with Problems 1 through 5, send me an email message that tells me the location of your five shell scripts.

Back to the Handout index