例如文件 aaa
内容:
aaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbb
ccccccccc ddddddddddddddd eeeeeeeeeeeeeeeee
ffffffffffffffffffffffffffffffffffffffffffffffffffff
gggggggggggggg hhhhhhhhhhhhhhhhhh
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
######################################################
#!/bin/sh
filename=aaa
num=`cat $filename |wc -l`
echo $num
i=1
while [ $i -le $num ] ; do
line=`sed -n "$i,$i p" $filename`
echo $line
i=$(($i+1))
done
阅读(1627) | 评论(2) | 转发(0) |