#!/bin/sh

#
#  Echoes the Production HPSS Class of Service Id for the
#  file specified in the first argument.  The Class of Service
#  Id is based on the size of the file.
#
if [ $# -eq 1 ] 
then
     file=$1
     if [ -f $file ]
     then
        size=`ls -l $file | awk '{print $5}'`
        if [ $size -lt 1000000 ]
        then
           echo "121"
        elif [ $size -lt 32000000 ]
        then
           echo "121"
        elif [ $size -lt 2048000000 ]
        then
           echo "121"
        else
           echo "131"
        fi
     else
        echo "file $file does not exist."
        exit 2
     fi
else
     echo "usage: getcosid.sh filename"
     exit 1
fi

exit 0
