in reply to Re^2: extract (a range of) numbered lines from a file -- smarter oneliner 22chars
in thread extract (a range of) numbered lines from a file
perl -E "say+(0,<>)[eval pop]" linenumber.txt 1,3..5
I was sure to have tested the empty diamond, but evidently not.. ;=)
L*
PS 19 chars if I can cheat:
perl -snlE "say if $.~~[eval$R]" -- -R="2,3..5" linenumber.txt
L*
|
|---|