File is not creating which i marked red colour in below code.Not sure what the issue is even i replaced echo with touch then alos no luck.please anyone help me.
while read file;
do
data_file=$file
ctl_file=`echo $file|cut -f1 -d.`.ctl
if [ -f $ctl_file -a -s $ctl_file ]; then
echo "Control file exists. Looking up the record count value from the Control file" >> $log_file
echo "Control file exists. Looking up the record count value from the Control file"
ctl_file_cnt=`sed 's/�/\|/' $ctl_file |cut -f2 -d'|'`
data_file_cnt=`sed '1d' $data_file|wc -l`
file_nme1=`echo $file|cut -f1 -d.|sed -e 's/'$app'//'`
file_nme=`echo $file_nme1|sed -e 's/'$dte'//'`.dat
if [ $ctl_file_cnt == $data_file_cnt ]; then
echo "The counts in the data file $data_file and the control file $ctl_file match!"
echo "Passing on the file for the data load"
echo $INFA_SRC_DIR/$file > $INFA_SRC_DIR/$filenme-not creating
#mv $INFA_SRC_DIR/$file $ARCHIVE_DIR/$file
else
echo "The counts in the data file $data_file and the control file $ctl_file does not match!"
echo "The file is not passed for the data load"
echo $file >> $tmp_dir/mismtch_files.txt
msmtch_file="INVALID_"$file
mv $INFA_SRC_DIR/$file $ARCHIVE_DIR/$msmtch_file
fi
else
echo "Control file not found in the directory / or the file may be invalid" >> $log_file
echo "Control file not found in the directory / or the file may be invalid"
echo $data_file >> $tmp_dir/no_ctl_files.txt
msmtch_file="INVALID_"$file
mv $INFA_SRC_DIR/$file $ARCHIVE_DIR/$msmtch_file
fi
done < $tmp_dir/files2bprcsd.txt
[/CODE]