#!/usr/local/bin/perl5 # selects given range of lines #check for correct usage if ($#ARGV < 0) { print "usage: sellines []\n"; print "Line count starts at 1.\n"; exit; }; $from = shift(@ARGV); if (@ARGV) { $to = shift(@ARGV); } else { $to = $from; }; if ($to < $from) { die " MUST BE LESS THAN !\n"; }; while (<>) { chop; $ln++; if ($ln > $to) { exit; }; if ($ln >= $from ) { print; }; };