[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Shell Question..



On Mon, 21 Jul 2003, Rus Foster wrote:

> 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?

Boy, reminds me of the old "useless use of cat" award... I always
use:

sed -n 5,5p /tmp/file

-jeff
-- 
"We demand rigidly defined areas of doubt and uncertainty!"
 -- Vroomfondel, Hitchhiker's Guide to the Galaxy, Douglas Adams



Reply to: