HELP PLEASE!! school assignment due in two hours!!

The assignment is worth 100 points.

Write a shell script that implements a report writer. The script file should be called "report" and should be invocable as

report

from the command line. In your script you may use common Unix commands: make sure that your script runs fine on lx.cs.niu.edu.

The script uses 3 data files -- called "products", "sales", "associates" -- as described below:

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

(click here to see examples of these files.)

The script should compute the sale amounts per associate for the year 2008 and print them in a list ranked according to the sales amount. Your script should invoke Unix commands on the above files to produce a report on standard output. Here is an example of the script invocation using the data provided in the example files above:

$ ./report
Marine Parts R US
2008 Sales Associates Ranking

Name            Position    Sales Amount
========================================
Fast Buck       Stock Boy        2408.87
George Bush     President        1059.67
Susan Worker    Manager           139.76
John Doe        Clerk             134.01
Hillary Clinton Candidate          31.00
$

Make sure that your script repors any error, such as problems with the input files, and that all temporary files are removed once the script ends.

I HAVE NO IDEA HOW TO GET THIS TO WORK, I HAVE GOTTEN SOME CODE DOWN BUT IT GETS STUCK ON ONE PART. HERES MY CODE, SOMEONE PLEASE HELP ME!!!!

#! /bin/bash
awk '/2007/ {print $0}' sales > /tmp/newSales.$$
#wc -l /tmp/newSales.$$ | cut -c1-2 > $LINES
LINES=`wc -l /tmp/newSales.$$ | cut -c1-2`
echo lines in file $LINES
COUNTER=21
while [ $COUNTER -le 26 ]
do
COUNT=1
while [ $COUNT -lt $LINES ]
do
awk '$4 == $COUNTER {print $0}' /tmp/newSales.$$ >> /tmp/sales.$COUNTER.$$
let COUNT=$COUNT+1
done
echo "SALES FOR ASSOCIATE $COUNTER"
cat /tmp/sales.$COUNTER.$$
let COUNTER=$COUNTER+1
done

#Below removes all created files
rm /tmp/newSales.$$
i=21
while [ $i -le 26 ]
do
# rm /tmp/sales.$COUNTER.$$
let i=$i+1
done

I THINK THE PROBLEM IS IN.....

awk '$4 == $COUNTER {print $0}' /tmp/newSales.$$ >> /tmp/sales.$COUNTER.$$

No homework questions here, read the rules.