Loop to read a file line by line in terminal