Execution problem

Hi,
I have been trying to run a simple script

CONFIG_FILE="/jay/check"
.
.
.
for i in `cat $CONFIG_FILE`
do
loc=`echo $i | cut -d "|" -f2`
var=$(find $loc -mtime -1|wc -l)
if [ var -ne 0 ] then
echo $loc has files older than 1 day
fi
done
.
.
.

but i m getting the error "0403-057 Syntax error at line 30 : `if' is not expected"

Can someone pl help me with this?

you need to dereference var with $var and also

if [ var -ne 0 ] then

should be

if [ var -ne 0 ]; then

Useless Use of Backticks

Never use 'for' with open ended lists. Use

while read LINE
do
...
done < inputfile