Sometime Today, m cobbled together some glyphs to say:
if [ `printf "$RECORD" | awk -F\| '{ print NF }'` -ne $FIELDS ]; then NM_CNT=`expr $NM_CNT + 1` printf "NM_CNT=$NM_CNT\n" fi
done printf "NM_CNT=$NM_CNT\n" return $NM_CNT
I am a novice at programming but so don't flame me if I am wrong but the problem can be with the line marked in bold. Shouldn't you be returning NM-CNT instead of $NM_CNT?
I don't see NM-CNT anywhere in his code, so not sure how you came to that. Also, there is nothing bold in your mail (hint, we block HTML on this mailing list).
Philip