in reply to Print some lines in a range
-p + <>???
-p + print???
Your code should be
perl -e"@lines=<>; print @lines[41900..50000];" data02.log > data03.lo +g
As for your question,
perl -ne"next if $.<41901; print; exit if $.==50001;" data02.log > dat +a03.log
($. is one-based while arrays are zero-based. That's why I changed the indexes by one.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Print some lines in a range
by ranrodrig (Novice) on Mar 06, 2010 at 04:15 UTC | |
by ikegami (Patriarch) on Mar 06, 2010 at 23:19 UTC |