1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
.\" Process this file with
.\" groff -man -Tascii blm.1
.\"
.TH blm 1 "DEC 2007" Linux "User Manuals"
.SH NAME
blm \- manipulate line oriented files using boolean set operations and, or, exclusive or, and set difference.
.SH SYNOPSIS
.B blm firstfile [+afile] [-bfile] [%cfile] [\\\\&dfile] [@]...
.SH DESCRIPTION
.B blm
reads in one or more line-oriented files and considers each file as a set of
strings. Blank lines do not represent the empty string, but instead are
ignored. The first command line argument shown as firstfile above
represents the starting set of lines. The arguments are then interpretted
according to Forward Polish Notation (FPN), as described by Jan Lukasiewicz.
Jan invented the first widely accepted non-classical logic as well as this
excellent notation. FPN requires no parentheses to describe arbitrarily
complex combinations of any number of binary operations.
Each successive command line argument
after the first represents an operation that starts with the accumulator
set A, applies the set operation A op B, and then stores the result in
the accumulator A. Another set operation may then be performed until all
listed arguments are used up. The result is then printed in lexicographical
order to standard output. Four operations are supported: Set union is
the plus symbol (+). Set intersection is the and symbol ( & ) which must be
escaped in most shells. Set difference is the subtraction symbol (-). And
set exclusive or is represented by the percent sign (%). There is also an
optional shuffling symbol toggle, (@), that means to randomly shuffle
all output lines instead of sorting in lexicographical order.
Thus, a simple way to randomize lines in a file is
as follows:
.TP
blm firstfile @
.TP
If a filename of "-" is listed, it represents the standard input to blm.
If none of the four option characters appears at the beginning of a filename
argument, set addition (+) is assumed.
.SH ENVIRONMENT
No environment variables.
.SH BUGS
Please report bugs to the Debian BTS.
.SH AUTHOR
Rudi Cilibrasi <cilibrar@cilibrar.com>
|