March 26, 2002; Ralph E. Griswold
This file is in the public domain.
This program is designed to extract a few specified lines from a file.
The line numbers are given on the command line, the file is read from
standard input and the extracted lines are written to standard output
as in
getlines 46 23 119 <infile >outfile
which writes lines 23, 46, and 119 of infile (if it contains that many
lines) to outfile.
Line numbers do not have to be given in order. Numbers less than 1 are
ignored, but a nonnumerical argument is treated as an error.
Source code |
Program Library Page |
Icon Home Page