bcnumsg - bcnu log file scanner



bcnumsg - bcnu log file scanner (and more!)


bcnumsg -p string | -s | -n name | -d | -v filename


bcnumsg is a program which reads through a file, normally a log file.

It can scan for a string and print out all lines containg that string. This output can be used for more powerful scanning by grep/awk etc.

It is intelligent enough to store it's last position in the file and only read from there onwards. If the file is initialized, it will start from the beginning again.

A file called BCNUHOME/flags/xxxxxx.pos is created to hold the position of the last read of the file. The xxxxxx is based on the input filename.


bcnumsg accepts the following command line options:

-p string

The -p option tells the bcnumsg program to check each line of the file read for a string. If the string is found it will print the line. If this option is not specified, all lines read will be printed.


The -s option tells the bcnumsg program not to update its .pos file. This file is used to keep track of the last position read within the file. It may be useful if multiple passes thru the file are required.

-n name

The -n option allows the bcnumsg program to specify a filename prefix which will be used to create the .pos file instead of the input filename

e.g. if I am processing /var/adm/messages then the .pos file will be called BCNUHOME/flags/messages.pos

If I specifiy -n fred the .pos file will be BCNUHOME/flags/fred.pos


The -d option switches on some debugging (not up to much yet!)


The -v option switches on slightly more verbose output (not up to much yet!)


bcnumsg quits with an exit value of 1 if there is an error. The error string is printed to stderr via perror(3).

An exit value of 0 is returned on success.


 BCNUHOME/flags/filename.pos    file which holds the position last read


 BCNUHOME               Set to a the bcnu home directory
 BCNUAGENT              Set to the name of the running agent
 BCNUHOST               Set to the hostname of the master system


John Phillips

Please send all bugs, comments, and changes to


This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Artistic License for more details.


Security is weak at the moment. bcnu is designed to be easy to use, it has not been tested for all vulnerabilities.


bcnud(1), bcnumsg(1), bcnu(1), agents(5), services(5), logpatterns(5), hostinfo(5), bcnunet(5)

The bcnu home pages also have full documentation

Updated: 14th October 1999


   bcnumsg - bcnu log file scanner