To simplify that further, use what grail suggests, but also just put an echo line in your loop. Example:
Code:
set -xv
while read IP
do
echo "IP value is $IP";
done <IPvar
And then verify that all values in IPvar are read properly.
What's the nature of IPvar, is that just a list? If so and you intend to perform a loop on all entries of IPvar, then why not just a for loop?