URL: http://www.firstbasesoftware.com/man/man1/dbfilter.htm
Last modified: 3 April 1996
Copyright © by FirstBase Software.
[
Index of Contents] [
FirstBase RDBMS Overview]
The result, filter_index, is a complete FirstBase index. (Note: since dbigen(1) is not used to generate filter_index, no *.idicti file is used). Error messages are generated for each filter_file request that cannot be referenced. Using -a finds all occurrences of each filter line, and -s sorts filter_index after completion.
The -c switch allows setting the number of character columns or positions that will be used to generate the index search key. Normally, the width of the index indicates the number of character columns required to match during the index lookup. The filter_file can be wider than this -- only the first columns are used to reference the indexed record. The columns can also be set to less than the width of the index.
The -b flag will run the FirstBase tool in batch mode, suitable for shell scripts. This mode produces no output on the terminal, thus can also be used when running the process in the background. The -y flag will run the tool at the terminal without pausing to ask the user if existing files can be destroyed.
If the filter_file specified is -, standard input (the keyboard)
is read, and batch mode (-b) is set. This works also when batch mode
is set, but no filter_file is specified. For example the following
is valid:
grep pattern text_file | dbfilter -d dbase -i index -f new -c 10 -b
Another interesting use of dbfilter can be achieved by generating an index (dbigen(1)) and using dbawk(1), dbemit(1) or dbmerge(1) to generate a filter_file. This filter_file can then be edited or filtered using other Unix tools (sed(1), awk(1), etc). The filter_file is then used to generate a new FirstBase index, usable with existing tools and scripts. Remember to make the first part of the filter_file look like the first part of the indexed field.
Dbfilter(1) provides a convenient method of filtering an existing FirstBase index into a new index that can then be used anywhere in the FirstBase system.
FirstBase User's Guide and Reference Manual