perl -e"open ARGV,'<',$ARGV[0]or die $!; while(){ print if $. >=15 and $. <=17 }" file