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: [EMAIL PROTECTED] | Totally Customizable Technology
> e: [EMAIL PROTECTED]       | FreeBSD & Linux
>        10% donation to FreeBSD.org on each purchase

-- 
They are relatively good but absolutely terrible.
                -- Alan Kay, commenting on Apollos


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to