While read do, then echo, gives double output

Sorry about the title, but this should be fairly self-explanatory.

My script seems to work, except that in the output, below, the first three lines are correct, but why does it print the additional lines 4, 5, & 6?

Script:

#!/bin/bash

while read;
do
 client="$(grep -m 1 Client | awk -F" " '{ print $2; }')"
 elapsed="$(grep -m 1 "Elapsed time" | awk -F" " '{ print $3,$4,$5,$6,$7,$8; }')"
 volname="$(grep -m 1 "Volume name" | awk -F" " '{ print $3; }')"

 echo The client name is $client
 echo The elapsed time was $elapsed
 echo The Volume name is $volname

done < /home/mine/bakupresult
exit 0

Result

The client name is "BaculaServer-fd"
The elapsed time was 1 min 57 secs
The Volume name is 000003L3
The client name is
The elapsed time was
The Volume name is

How can I stop those last 3 lines from being output?

Any help appreciated.

i can only guess you have a blank line at the end of your input file?

Blank line in the file /home/mine/bakupresult.
Give a

cat -e /home/mine/bakupresult

to check

Thanks guys,

robsonde: Yes there was a blank line at the end. I removed it, but no change. :frowning:

dennis.jacob: Thanks for the 'cat -e' command/switch. There is indeed a blank line about 5 lines from the bottom of the input file. This input file is just for testing purposes, the actual input will hopefully come from STDIN, but in exactly the same format as the current input file.

So, is there something that I can add so that blank lines will be ignored?

regards,
Ken