Well, ok then, to make it stop on a long file:
sed -n '100p; 100q' filename
make sure the address on q is higher than anything you want to print
> -----Original Message-----
> From: Mark D. Stock [SMTP:mdstock@mydas.freeserve.co.uk]
> Sent: Tuesday, September 05, 2000 4:22 PM
> To: Prasad Mahale
> Cc: informix-list@iiug.org
> Subject: Re: Quick Help...Shell script...
>
> Prasad Mahale wrote:
> >
> > Hi All,
> > How can i get nth line (for example say 100th line) from a text file
> > directly?
> > I don't want to scan whole file for that using a loop.
> > Like TOP and TAIL command, is there anything to read a range of lines
> > in-between?
>
> How about:
>
> head -100 myfile |tail -1
>
> I don't THINK head scans beyond the required lines.
>
> If you wanted a range of lines, say 90-100, then obviously:
>
> head -100 myfile |tail -10
>
> Did I stray into c.u.s instead of c.d.i? :-)
>
> Cheers,
> --
> Mark.
>
> +----------------------------------------------------------+-----------+
> | Mark D. Stock mailto:mdstock@mydas.freeserve.co.uk |//////// /|
> | http://www.informix.com http://www.informixhandbook.com |///// / //|
> | http://www.iiug.org +-----------------------------------+//// / ///|
> | |This email will self-destruct in |/// / ////|
> | |10 sec. If you received this email |// / /////|
> | |in error, sorry about the mess. |/ ////////|
> +----------------------+-----------------------------------+-----------+