Sometime Today, VS cobbled together some glyphs to say:
verify_record() { FILE=$1 FIELDS=$2 cat $FILE | while read RECORD do 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 }
Here is the output. The maximum value of NM_CNT in the loop is 2, but once it comes out of the loop, its value becomes "0".
Return value is stored in $? after the function returns, check the value of $?
Also, configure your mail client to wrap long lines at approxy 74 characters.
Philip