In continuation of this thread I am happy to say that I improved and extended the script. The new options
--file=FILE,
--or and
--and are shipped with new version. In accordance of the script description they work as follows:
-f FILE,
--file=FILE
Obtain patterns from
FILE, one per line.
-A,
--and,
-O,
--or
These options specify whether multiple search patterns specified by the
-e options should be logically
ANDed together or logically
ORed together. If not specified, the patterns are assumed logically
ORed. These options can be used to simplify the commands searching for matches to multiple patterns. More than one of them can be specified but the only last pattern has affect.
The following example shows how the combining option simplifies usage. The
resulting output will consist of the paragraphs matching both
PATTERN1
and
PATTERN2.
cat FILENAME | paragrep -e PATTERN1 -e PATTERN2 -A
cat FILENAME | paragrep -e PATTERN1 | paragrep -e PATTERN2
Welcome for meditations, Monks :)