README
1 README file for sgrep version 1.0 -
2 a tool to search a file for structured pattern
3
4 Copyright (C) 1995 University of Helsinki
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 Authors: Pekka Kilpelainen Pekka.Kilpelainen@cc.helsinki.fi
21 Jani Jaakkola Jani.Jaakkola@cc.helsinki
22
23---------------------------------------------------------------------------
24
25See manual page, which comes with this distribution for description and
26usage of sgrep.
27
28See announce or sgrep home page at
29 http://www.cs.helsinki.fi/~jjaakkol/sgrep.html
30to see on which systems sgrep has been tested.
31
32INSTALLATION
33------------
34
35Edit the Makefile to choose installation directories and programs.
36If you wish, you can edit config.h to choose different default behaviour.
37The defaults should be quite reasonable.
38
39Type 'make' to compile sgrep
40Type 'make install' to install sgrep binary and manualpage.
41
42MACRO FILES
43-----------
44
45Complex queries with sgrep are painful to create without a macro
46preprocessor. Since sgrep doesn't have inbuild macro preprocessor,
47external one is used. It defaults to m4, and sample macro files are in
48m4 format. Therefore you need m4 to use them. To fully utilize sgrep
49I recommend to make friends with some preprocessor ( I used to use cpp).
50
51There is an example 'sample.sgreprc' macro file, which can be installed
52with 'make install.rc'. In this file there is a macro MACRO_NAMES with which
53you can query macro names from macro libraries. Use it with command like
54
55 %sgrep -nfo "%r\n" sample.sgreprc -e MACRO_NAMES sample.sgreprc
56
57or if you have already installed the macro file
58
59 %sgrep -o "%r\n" MACRO_NAMES sample.sgreprc
60
61There is also few more macro files in the macros subdirectory.
62
63Example sgrep commands (using macros from sample.sgreprc) could be
64
65 %sgrep -o"%f:%r\n" "MACRO_NAMES" sample.sgreprc
66 %sgrep "MAIL_SUBJ or MAIL_FROM" $MAIL
67 %sgrep C_PROTOS main.c
68 %sgrep -o"%f:%r\n" HTML_TITLE ~/public_html/*.html
69
70SGTOOL
71------
72
73sgtool is a tcl/tk based X interface to sgrep. It requires tk version 4.0.
74If your wish binary is in some other directory than '/usr/local/bin' you
75have to edit the first line of sgtool.tcl to look like this
76
77#!/My-wish-binary-directory-prefix/wish
78
79instead of
80
81#!/usr/local/bin/wish
82
83There is also xbm icon for sgtool named 'sgtool.icon'
84
85MORE INFORMATION
86----------------
87
88more information, examples and newest version of sgrep will be found
89from url http://www.cs.helsinki.fi/~jjaakkol/sgrep.html
90
91That's it, good luck and enjoy!
92