MPE/iX Shell and Utilities Reference Manual, Vol 1

cut(1) MPE/iX Shell and Utilities cut(1)
NAME
cut — selectively display fields or characters from input lines
SYNOPSIS
cut –b list [–n][file...]
cut –c list [file...]
cut –f list [–d char][–s][file...]
DESCRIPTION
cut reads input from files and selectively copies sections of the input lines to the standard
output. If you do not specify any files, or you specify a file named , cut reads from the stan-
dard input.
Options
cut accepts the following options:
–b list invokes byte position mode. After this comes a list of the byte positions you want to
display. This list may contain multiple byte positions, separated by commas (,)or
blanks or ranges of positions separated by dashes (); since the list must be one argu-
ment, shell quoting is necessary if blanks are used. You may combine these to allow
selection of any byte positions of the input.
–c list invokes character position mode. After this comes a list of character positions to
retain in the output. This list may contain multiple character positions, separated by
commas (,) or blanks or ranges of positions separated by a dash (); since the list
must be one argument, shell quoting is necessary if blanks are used. You may com-
bine these to allow selection of any character positions of the input.
–d char
specifies char as the character that separates fields in the input data; by default, this is
the horizontal tab.
–f list invokes field delimiter mode. After this comes a list of the fields you want to display.
You specify ranges of fields and multiple field numbers in the same way you specify
ranges of character positions and multiple character positions in –c mode.
–n does not split characters. If the low byte in a selected range is not the first byte of a
character, cut extends the range downward to include the entire character; if the
high byte in a selected range is not the last byte of a character, cut limits the range
to include only the last entire character before the high byte selected. If –n is
selected, cut does not list ranges that do not encompass an entire character and these
ranges do not cause an error.
Commands and Utilities 1-147