READINFO(1) 06:53:22 READINFO(1)
readinfo - read fields from a relational
readinfo [ -a ] [ -i filename ] [ -o filename ] [ -L ] fieldname ...
Reads a formatted table in a relational format with named fields.
Input is from stdin unless the -i is specified. Output is to stdout
unless the -o option is specified. The -a option specifies output
should be appended to the output file instead of overwriting the output
file. The -L option specifies line numbers shoudl be prepended to each
The file is described by a special comment or meta command which
defines the field names and any prefixes or suffixes to add to each
field. The following is a simple example which illustrates the usage.
# short readinfo example
#FIELDS GLOBAL null=X no=. domain suffix=.tic.com ip prefix=192.135.128.
The special #FIELDS comment (can also be specified as $FIELDS)
describes each field in the file. Field descriptions appear in the
order the appear in the file. There is no whitespace between the #
and the FIELDS. FIELDS must be all uppercase.
In this example two fields with the names "domain" and "ip" are
defined. The special field "GLOBAL" defines global parameters which
apply to all fields in the file. Each field description is the name of
the field which can be any arbitrary name followed by optional field
parameters which are keyword=value pairs. The field parameters and
their semantics are:
Sets the empty field value to the . Whenever
appears as a field value, readinfo emits an empty value for the
Adds a prefix of to each field value output.
Adds a suffix of to each field value output.
Does not add a prefix or suffix to the field value whenever
either starts or ends the string respectively.
Only fields listed on the command line are output to stdout. For exam
ple the command
readinfo domain ip ,,
Generators may not be nested in the current implementation. Whenever
appears within curly brackets within the GENERATO construct, it is
replaced with the current loop value.
An example of a GENERATOR is:
#FIELDS host suffix=.tic.com ip prefix=192.168.128.
#GENERATOR num 97,102,1
THis produces the output:
4th Berkeley Distribution $Date: READINFO(1)