i have a script where i have to find the age of a file,
if [ -n "`find $DATA_DIR/1181*.dat -mtime -20`" ]
then
echo "dnb file is present for the monthly load" >> $RUNLOG
dnb="1"
else
echo "dnb file has not arrived yet" > $ERRLOG
dnb="0"
fi
i know the file is available so when i am echoing the value of $dnb, it is returning 1....
but later on when i am using this $dnb variable while condition checking then i am getting some error:
if [$dnb ==`1`];
then
cat $RUNLOG | mailx -s "Success: All the files are arrived for RDW monthly load, below is the status of files" "$MAI
L_DL"
else
cat $ERRLOG | mailx -s "Attention: All the files are still not arrived for RDW monthly load, below is the status of
files" "$MAIL_DL"
fi
instead of going to cat $runlog condition it is going to display $errlog and another error which i am getting is :
RDW_file_check.ksh[87]: 1: not found
please suggest..