file_dt=`head -1 nnnn_mi_claim_ext.dat | cut -c5-12`
file_val_dt=`cat cat dateval.txt`
if [ $file_dt -le $file_val_dt ]
then
exit 2
else
echo $str1 > dateval.txt
recnt1=`grep "^D" $1 |wc -l`
filerecnt=`tail -1 $1 |cut -d '~' -f3`
recnt=`printf "%09d" $recnt1`
if [ $recnt1 -eq $filerecnt ]
then
exit 0
else
exit 1
fi
fi
I have written this script to validate headers in the file. In "if" condition the variables $file_dt and $file_val_dt taking it as string i am not able to compare the dates. Does unix has a function to convert string to integer??
Please help me...
Regards
Akshu