COP 3344 Assignment 3
Due on Tuesday, March 16, at class time.
Write a shell script that implements a report writer. The script
file should be called "report" and should be invocable as
sh report
from the command line. The script will assume 3 input files -- called
"products", "sales", "associates" -- as described below:
In your script you may use common Linux commands: make sure that your
script runs fine on the Linux machine in the JCCL.
File Specifications (click on the file
name to get an example of the file):
products: has the following
fields, the field
separator is ":"
- product id: an integer number
- description: alphanumeric text
- price: floating point number, with 2 significant digits
sales: has the following fields,
the field separator
is ","
- product id: an integer number
- quantity: an integer number
- date: in the form of dd:mm:yyyy
- associate id: an integer number
associates: has the
following fields, the field
separator is "/"
- associate id: an integer number
- name: alphanumeric text
- salary: an integer number
- position: alphanumeric text
The script should compute the sale amounts per sales in the
month
of February, and print
them in a list ranked according to the sales amount.
Your script should invoke Linux commands on the above files to produce
a report on standard output. Here is an example of the script
invocation:
$ sh report
Marine Parts R US
Sales Associates Ranking
February 2004
Name Position Sale Amount
======================================================
John Doe Clerk 124.00
Susan Worker Manager 120.00
Fast Buck Stock Boy 92.00
Susan Worker Manager 12.00
$
Turning in Your Assignment:
- send e-mail to ege@cs.fiu.edu
- your e-mail submission should contain:
- your statement indicating that you did the assignment
personally
- the "report" shell script as a file attachment.
- Your email must
be sent from a Linux system !
- your e-mail submission may not
contain:
- the files products, sales,
associates ! I will use my own files for testing
This assignment is worth 30 points. The total score for all
assignments is 100 points.