Re: Shell Question..
try "sed -n 'x p; x q' filename "
That will print only line x
On Monday 21 July 2003 14:54, Rus Foster wrote:
> Hi All,
> No strictly on topic but can anyone think of a better way to print out
> line x of a file in Shell Script. Best I have so far is (in pseudo code)
>
> cat /tmp/file | head -$x | tail -$x+1
>
> Anything better or a perl one liner?
>
> Cheers
>
> Rus
> --
> www: http://jvds.com | Virtual Servers from just $15/mo
> MSNM: support@jvds.com | Totally Customizable Technology
> e: rghf@jvds.com | FreeBSD & Linux
> 10% donation to FreeBSD.org on each purchase
--
They are relatively good but absolutely terrible.
-- Alan Kay, commenting on Apollos
Reply to: