initial commit

This commit is contained in:
Fabio Scotto di Santolo
2020-07-28 19:28:25 +02:00
commit 4cc88d2f6e
245 changed files with 22820 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
function parse_variable_length_records
{
# set -x
# Zero out the $OUTFILE
>$OUTFILE
# Associate standard output with file descriptor 4
# and redirect standard output to $OUTFILE
exec 4<&1
exec 1> $OUTFILE
while read RECORD
do
# On each loop iteration extract the data fields
# from the record as we process the record file
# line by line
echo $RECORD | awk -F : '{print $1, $2, $3, $4, $5, $6}' \
| while read BRANCH ACCOUNT NAME TOTAL DATEDUE RECFILE
do
# Perform some action on the data
process_variablelength_data_new_duedate $BRANCH $ACCOUNT $NAME \
$TOTAL $DATEDUE $RECFILE $NEW_DATEDUE
if (( $? != 0 ))
then
# Note that $LOGFILE is a global variable
echo "Record Error: $RECORD" | tee -a $LOGFILE
fi
done
done < $MERGERECORDFILE
# Restore standard output and close file
# descriptor 4
exec 1<&4
exec 4>&-
}