1、准备数据文件 $cat a.txt 200:2 300:3 400:4 500:5 2、用while循环从文件中读取数据 #!/bin/ksh while read line do echo $line done < a.txt