in reply to Grep the second line from a file?
Not sure what exactly you mean by "grepping the 2nd line from a file", could you provide some sample input with expected output?
# prints only the second line of the file perl -ne 'print if $.==2' -- FILENAME # prints only the second line of the file if it matches a pattern perl -ne 'print if $.==2 && /pattern/' -- FILENAME
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Grep the second line from a file?
by graff (Chancellor) on Mar 20, 2014 at 03:31 UTC | |
|
Re^2: Grep the second line from a file?
by Anonymous Monk on Mar 19, 2014 at 23:47 UTC |