Please Help - df script

I need help with a df script that I pulled from the web. This script is used to monitor disk space and email if it gets over a certain percentage (in this case, 90%). The script works, and it sends me an email, but when I test it I keep getting an output reporting:
dfalert[12]: -: 0403-053 Expression is not complete; more tokens expected.

The name of my script is "dfalert", and it's reporting a problem on line 12 of the script. Here is the code:
+1 ###################################################################
+2 #! /bin/ksh
+3 #
+4 ########################################################################################
+5 # This scripts monitors the disk space utilization and sends an email to the Admins if #
+6 # the amount of disk space for any file system reaches 90% or more. This script will #
+7 # run as an hourly cron job. #
+8 ########################################################################################
+9 #
+10 df -k |grep -iv filesystem |awk '{print $1 "\t" $4 "\t" $7}' |while read LINE; do
+11 PERC=`echo $LINE |cut -d"%" -f1 |awk '{print $2}'`
+12 if [ $PERC -gt 90 ]; then
+13 echo "The Filesystem ${LINE} on `hostname`" |mail -s "Disk Space Alert" user@host.com
+14 fi
+15 done

Any ideas as to what "tokens" I'm missing on line #12 would be greatly appreciated. Thank you in advance.

outta

There are a number of errors in that script, not least of which are

  1. Line 2 should be line 1, line 1 should not be there.
  2. It uses sh syntax, in ksh the [ ] should really be [[ ]]

Hi,
There is one more correction when you awk the output of df -k | grep -iv filesystem the $5 should extracted and not $4 as $4 will give avaliable space and not the capatcity in terms of percentage. Then this script would work fine.
Thanks

Thank you for your help. . .

I have made the corrections as advised by reborg and amitkhiare. Except now I'm catching errors on the following line:
PERC=`echo $LINE |cut -d"%" -f1 | awk '{print $2}'`

The error is saying:

dfalert[10]: -: 0403-053 Expression is not complete; more tokens expected.

What am I missing?

I'm not sure about the error, but you can do something like this to get your work done:

df -k | grep -iv filesystem | while read LINE; do
PERC=`echo $LINE | awk '{print $5}' | sed -e 's/%//'`

Regards,
Tayyab

Thank you for your assistance. . .it's now working.

Negatory. Modern ksh honors both - in ksh93, it is stated sometimes that "[[expr]]" is preferred, but it really makes no difference. In ksh88 and older versions of pdksh, you may run into problems. It really depends on what shell you're using.