Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15164020
  • 博文数量: 7460
  • 博客积分: 10434
  • 博客等级: 上将
  • 技术积分: 78178
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-02 22:54
文章分类

全部博文(7460)

文章存档

2011年(1)

2009年(669)

2008年(6790)

分类:

2008-05-03 11:02:24

#!/bin/sh
#set -x
if [ "$#" -lt 1 ];then
echo "Usage $0 [file] "
exit 1
fi
echo "Enter the line you want to choose from:"
read FromLine
echo "Enter the line you want to choose to:"
read ToLine

rm -rf temp.txt
Line=`echo "$ToLine-$FromLine" | bc`

x=0
exec < $i # opens the file you want choose the line from
while read line # read from the file
do
if [ $x -lt $Line ];then
printf "%s\n" "$line" >>temp.txt
x=`expr $x + 1`
else
echo "DONE"
exit 1
fi
done

#set +x
阅读(1472) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~