http://www.perlmonks.org?node_id=586645


in reply to reading the file using the line number

inspired by tom christiansens oneliners:

perl -ne 'print if $. == $number; exit if $. > $number;'

Edit: corrected typo, thx to davorg

--
"WHAT CAN THE HARVEST HOPE FOR IF NOT THE CARE OF THE REAPER MAN"
-- Terry Pratchett, "Reaper Man"

Replies are listed 'Best First'.
Re^2: reading the file using the line number
by davorg (Chancellor) on Nov 29, 2006 at 10:20 UTC
    perl -ne 'print if $. = $number; exit if $. > $number;'

    You probably want '==', not '=', there.

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg