NAME
fop – field operator
SYNOPSIS
fop [-d delimiter] index program [arguments...]
DESCRIPTION
Performs operations on specified fields in data read from the standard input.
OPTIONS
- -d delimiter
- Sets a delimiter by which the input data will be split into fields. The default is an ASCII record separator.
DIAGNOSTICS
in the event of an error, a debug message will be printed and the program will exit with the appropriate sysexits.h(3) error code.
CAVEATS
If the specified index does not exist in the data, the program will print all data to the standard output before exiting with an error. If input data is not delimited by the specified delimiter, the program will fill memory with the contents of the stream before it is output.
Field indices are zero-indexed, which may be unexpected behavior for some users.
RATIONALE
With the assumption that tools will output data separated with ASCII field separators, there is a need for the ability to modify select fields in this data easily and quickly.
The idea for this utility originated in the fact that the GNU ls(1) utility contains a -h option which enables human-readable units in file size outputs. This functionality was broken out into hru(1), but there was no easy way to modify the field in the ouput of ls(1p) without creating a new tool.
AUTHOR
Written by Emma Tebibyte emma@tebibyte.media.
COPYRIGHT
Copyright © 2024 Emma Tebibyte. License AGPLv3+: GNU AGPL version 3 or later <https://gnu.org/licenses/agpl.html>.
SEE ALSO
sed(1p)