#!/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
阅读(1494) | 评论(0) | 转发(0) |