prtrng [-h] Global_Opt Input_Spec Range_Spec
Global_Opt:
[-nolabel]
Input_Spec:
[-f File]
Range_Spec:
-b RngSpec [RngSpec ...] | -l RngSpec [RngSpec ...]
prtrng
reads an input file or stream and output selected ranges of data
from the input.
It is used to augment data processing program that output messages containing
byte or line ranges of certain data of interest but not the data themselves.
By passing the same input data and selected byte/line ranges to this program,
the data of interest can be inspected/sampled.
The program accepts either byte or line ranges (but not both). Byte range is perferred if available as it is more efficient. Output goes to stdout.
-nolabel
-f File
File
to ‘-‘ (a single dash).
If this option is not given, stdin is assumed.-b RngSpec [RngSpec ...]
Specify the byte ranges of data to print.
RngSpec
specify a range in one of these forms:
Pos
Pos
.BegPos-EndPos
BegPos
to EndPos
bytes, inclusive.BegPos+Num
Num
bytes starting at BegPos
(inclusive).Note that position starts at 1; that is, the first byte is 1.
Although the program accepts any RngSpecs
, it is best to follow
these rules:
Example:
$ prtrng ... -f file1 -b 100+20 1000+10 ...
-l RngSpec [RngSpec ...]
If successful, the program exits with status 0. Otherwise, the program exits with a non-zero status code along error messages printed to stderr. Applicable exit codes are:
Output from the program appears this way:
FileName: byte=BegByte+NumByte<newline> <selected data><newline>
or
FileName: line=BegLine+NumLine<newline> <selected data><newline>
The first line is a label line. FileName comes from -f. A byte range is shown if -b was used and a line range is shown if -l was used.
The subsequent block contains the selected data.