http://bbs.chinaunix.net/thread-251235-1-1.html
head -1 urfile sed 'q' urfile awk '{print;exit}' urfile |
http://blog.163.com/clevertanglei900@126/blog/static/1113522592011625112619590/
1 -- SHELL读取文件的方法
#使用read命令读取一行数据
while read myline
do
echo "LINE:"$myline
done < datafile.txt
#使用read命令读取一行数据
cat datafile.txt | while read myline
do
echo "LINE:"$myline
done
#读取一行数据
cat datafile.txt | while myline=$(line)
do
echo "LINE:"$myline
done
#读取一行数据
while myline=$(line)
do
echo "LINE:"$myline
done < datafile.txt
#使用read命令读取变量数据
cat datafile.txt | while read paraa parab parac
do
echo "PARAA:"$paraa
echo "PARAB:"$parab
echo "PARAC:"$parac
done
#使用read命令读取变量数据
while read paraa parab parac
do
echo "PARAA:"$paraa
echo "PARAB:"$parab
echo "PARAC:"$parac
done < datafile.txt