        README file for sgrep version 1.0 - 
	a tool to search a file for structured pattern

        Copyright (C) 1995  University of Helsinki

        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        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
        GNU General Public License for more details.

        You should have received a copy of the GNU General Public License
        along with this program; if not, write to the Free Software
        Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

        Authors: Pekka Kilpelainen       Pekka.Kilpelainen@cc.helsinki.fi
                 Jani Jaakkola           Jani.Jaakkola@cc.helsinki

---------------------------------------------------------------------------

See manual page, which comes with this distribution for description and
usage of sgrep.

See announce or sgrep home page at 
	http://www.cs.helsinki.fi/~jjaakkol/sgrep.html
to see on which systems sgrep has been tested.

INSTALLATION
------------

Edit the Makefile to choose installation directories and programs.
If you wish, you can edit config.h to choose different default behaviour. 
The defaults should be quite reasonable.

Type 'make' to compile sgrep
Type 'make install' to install sgrep binary and manualpage.

MACRO FILES
-----------

Complex queries with sgrep are painful to create without a macro
preprocessor. Since sgrep doesn't have inbuild macro preprocessor, 
external one is used. It defaults to m4, and sample macro files are in 
m4 format. Therefore you need m4 to use them. To fully utilize sgrep 
I recommend to make friends with some preprocessor ( I used to use cpp).

There is an example 'sample.sgreprc' macro file, which can be installed
with 'make install.rc'. In this file there is a macro MACRO_NAMES with which
you can query macro names from macro libraries. Use it with command like
 
 %sgrep -nfo "%r\n" sample.sgreprc -e MACRO_NAMES sample.sgreprc

or if you have already installed the macro file
 
 %sgrep -o "%r\n" MACRO_NAMES sample.sgreprc

There is also few more macro files in the macros subdirectory.

Example sgrep commands (using macros from sample.sgreprc) could be

 %sgrep -o"%f:%r\n" "MACRO_NAMES" sample.sgreprc
 %sgrep "MAIL_SUBJ or MAIL_FROM" $MAIL
 %sgrep C_PROTOS main.c
 %sgrep -o"%f:%r\n" HTML_TITLE ~/public_html/*.html

SGTOOL
------

sgtool is a tcl/tk based X interface to sgrep. It requires tk version 4.0.
If your wish binary is in some other directory than '/usr/local/bin' you
have to edit the first line of sgtool.tcl to look like this

#!/My-wish-binary-directory-prefix/wish

instead of

#!/usr/local/bin/wish

There is also xbm icon for sgtool named 'sgtool.icon'

MORE INFORMATION
----------------

more information, examples and newest version of sgrep will be found
from url http://www.cs.helsinki.fi/~jjaakkol/sgrep.html

That's it, good luck and enjoy!
