while read line

do

 echo $line

done <file.txt

以file.txt作为输入,用read循环读取每一行