从文件中读取数据

5年以前  |  阅读数:559 次  |  编程语言:Shell 
#!/bin/bash
# reading data from a file

count=1
cat test | while read line
do
    echo "Line $count: $line"
    count=$[ $count + 1 ]
done
echo "Finished processing the file"

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8