#!/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
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