Of course it echoes all lines...

You're looping from 1 to 10, so all 10 of those if statements are going to be matched at some point in the loop.