CSCI 330 Fall 2001
C-Shell Programming Assignment
Due 1 November 2001 Thursday

General purpose

Write a c-shell script that will mail the assignment[s] specified to your professor and TA. The program will ask for the assignment number and check it for valid value. It will then ask for your section number and check for valid value. Next it will ask for a list of files to email the appropriate people. It will check for the existence of those files before proceeding. Then mail each file specified, include on subject line the assignment id.

Pseudo-code with hints and requirements

Create an endless while loop End of while

Prompt the user for the section number they are in. Remind them of which TA is assigned to which sections. Greg Noth (z018079) Sections 1 & 5, Olga Urban (z987658) Sections 3 & 7. You must code the program to allow any of the sections (and thus either of the TAs) to be selected.

Get input (Section number) from user and test for valid value using grep.
While input not valid

Prompt user for the name of all files related to current assignment. The user will issue all names on a single input line which will be assigned to an array.

Set an error code variable to 0

Using the appropriate for loop to retrieve each filename one at a time, test each file for the following conditions and report on any problems. Follow the general structure describe below.

If the return code is greater than zero Show the user the list of checked file names
Ask the user if she/he wishes to mail the files

If the user wishes to continue

Else