The information to be stored for every day is: day, month, year, day of the week (Monday, Tuesday, ...) and appointments. Appointments should be stored as one string per day. Several appointments for a single day should be concatenated into one string.
The interface to the calendar must be from the Unix command line (no CGI). At the beginning the user is asked whether he/she would like to print the information for a specific week or whether he/she would like to enter new appointments.
In the first case, the user is asked to type in day/month/year. Then the week (Monday through Sunday) which contains that day is printed with all its information in some kind of tabular format.
In the second case, the user is asked to type in day/month/year If the day already contains an appointment, the user is given the options to either delete the old appointment, replace the old appointment with a new one or to add a new appointment. If there is no old appointment, the user is only asked to enter the new appointment.
In both cases, the script then starts over by asking the user whether he/she would like to print the information for another week or to enter more appointments. A third option at this point is to exit the program. The script should only stop if the user selects "exit" at this point, otherwise it should keep running.
Note: it is not necessary to store any of the information in a file. That means that all appointments will be lost once the program stops.
First, the script checks that the words do not contain any unusual characters apart from word characters, any kind of blank space, or a hyphen. If an unusual character occurs, the script should stop (or die).
Then the script searches the file for the words. It outputs the following information to a file called output.txt:
How often each of the two words occurs in total.
How many lines contain at least one of the two words.
How many lines contain both words.
How many lines contain none of the two words.