I'm learning about the read command and wrote this little script to read data from a file:

 while read variable; do
echo $variable
readfile < File.txt
I have three lines in File.txt; each a single word. The script only echoes the first two lines and drops the third one. Can anyone tell me why?

Also, what does the statment

if [ $variable ] mean? Does it mean 'if the value of variable exists....'?

File.txt only consists of the words red, blue and green.