The code here is in a sub-shell, so modifications to $NUM_CDDB_MATCHES
do not persist in the parent. Yay shell. Work around this.
# Multiple exact, (possibly multiple) inexact matches
vecho -n "Retrieving multiple matches... "
grep -v ^[.]$ "${SOURCE_WORKDIR}/cddbquery" | (
+ # IN A SUB-SHELL - VARIABLES MODIFIED
+ # HERE DO NOT PERSIST IN THE PARENT
read DISCINFO # eat top line
while read DISCINFO
do
echo cddb-read-${NUM_CDDB_MATCHES}-complete >> "$ABCDETEMPDIR/status"
fi
done )
+ # Need to re-count the entries here to be able
+ # to incrememnt $NUM_CDDB_MATCHES in the
+ # parent
+ NUM_CDDB_MATCHES=$(($NUM_CDDB_MATCHES + $(ls -1 ${SOURCE_WORKDIR}/datasource.* | wc -l)))
vecho "done."
;;
999)