r=mjmac
r=yujian
If anything inside the "while read; do ... done" loop (or it's callees)
reads from stdin (a very common thing to do) it will consume input meant
for the read since it's reading from stdin with ${CSV_FILE} being
redirected to stdin. Read on another file descriptor to avoid this.
declare -i line_num=0
declare -i idx=0
- while read -r LINE; do
+ exec 9< ${CSV_FILE}
+ while read -u 9 -r LINE; do
line_num=${line_num}+1
# verbose_output "Parsing line ${line_num}: $LINE"
fi
idx=${idx}+1
- done < ${CSV_FILE}
+ done
return 0
}