linux 一行一行的读取文件

#!/bin/bash
#reading data from a file
count=1
cat test1 | while read line
do
        echo "Line $count: $line"
        count=$[ $count + 1 ]
done
echo finished processing the file

~                                    

 

posted @ 2017-06-06 16:23  牵牛花  阅读(3975)  评论(0编辑  收藏  举报