


tgrep(1)                  User Commands                  tgrep(1)



NNNNAAAAMMMMEEEE
     tgrep - A multi-threaded version of grep with new features.

SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
     ttttggggrrrreeeepppp <<<<ooooppppttttiiiioooonnnnssss>>>> ppppaaaatttttttteeeerrrrnnnn <<<<{{{{ffffiiiilllleeee////ddddiiiirrrr}}}}>>>>............


DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
     ttttggggrrrreeeepppp supports all of grep(1) options  except  for  the  - w
     option. It also has a number of custom options not supported
     by grep(1)

     tgrep will supply three different usage  messages  depending
     on the arguments you pass to it to get more information. The
     first is the option usage, which can be viewed  by  starting
     tgrep with no option. The second is the usage for tgrep reg-
     ular expression language, which can be used by running tgrep
     with the -Z option. The last usage message is avaliable only
     if tgrep was build with DEBUG turned  on.  If  this  is  the
     case, starting tgrep with the -d0 (zero) option will display
     the usage on the different levels of debug information tgrep
     will display.

     Tgrep will search all directories and all files in the named
     directories  on  the command line for a literal string, or a
     regular expression string.  tgrep  will  search  recursively
     down  through  the  sub-directories. The same type of search
     could be performed by using the command:

     find . -type f -exec grep <pattern> /dev/null {} \;

     or using tgrep:

     tgrep <pattern> .

     If you do not specify a directory or file name on  the  com-
     mand  line,  the  current working directory is added for you
     (DOT). All files in the current directory and all  files  in
     all sub-directories below . (dot) will be searched.

     Tgrep supports two different pattern matching  engines.  The
     default  is  a  literal  pattern  matching  algorithm called
     "Boyer-Moore". This is used for fast literal string matching
     only. Tgrep supports regular expression searching also. With
     the -e option set, "Boyer-Moore" is not used,  in  place  of
     it, a PD regular expression engine is used.


OOOOPPPPTTTTIIIIOOOONNNNSSSS ((((ggggrrrreeeepppp((((1111)))) lllliiiikkkkeeee))))
     ----bbbb Show block count. Block size is 512 bytes.
     ----cccc Print only a line count.
     ----hhhh Do not print the file name(s).



SunOS 5.5           Last change: Apr 12 1995                    1






tgrep(1)                  User Commands                  tgrep(1)



     ----iiii Case insensitive search.
     ----llll Print file name only.
     ----nnnn Print the line number with the line.
     ----ssss Suppress error messages.
     ----vvvv Print all but matching lines.


OOOOPPPPTTTTIIIIOOOONNNNSSSS ((((TTTTggggrrrreeeepppp oooonnnnllllyyyy))))
     ----rrrr Do not search for files in all sub-directories.
     ----CCCC Show continued lines. Great for Makefile searches. ("\")
     ----pppp File name regexp pattern. (Quote it).
     ----PPPP Show progress. -P1 prints a DOT on stderr for  each  file
     it  finds,  -P10 prints a DOT on stderr for each 10 files it
     finds, etc...
     ----eeee Regular expression search. More then one  - e  option  is
     supported.
     ----BBBB Limit the number of threads to TGLIMIT  (see  ENVIRONMENT
     below).
     ----SSSS Print thread stats when done.
     ----ZZZZ Print help on the regexp used.



OOOOPPPPTTTTIIIIOOOONNNNSSSS ((((ddddeeeebbbbuuuugggg oooonnnnllllyyyy))))
     ----dddd <<<<lllleeeevvvveeeellllssss>>>> Print debug messages as tgrep is running to show
     what  thread  is  performing what operation. -d0 (zero) will
     print debug usage.
     ----ffff #### Stop tgrep from using "#" (number) of file descriptors.
     Tgrep  normally  will uses all the file descriptors the user
     has avaliable, but if tgrep is run under  debugger  control,
     you need to reserve some.


RRRREEEEGGGGEEEEXXXXPPPP LLLLAAAANNNNGGGGUUUUAAAAGGGGEEEE
     Tgrep supports a custom regular expression language write by
     Marc  Staveley  of Staveley.com. At the time tgrep was first
     written, libgen was not  MT-SAFE,  so  the  systems  regular
     expression  functions  could  not  be  used.  Marc's regular
     expression engine  supports  most  if  not  all  the  normal
     expressions, and some unique ones.

     mmmmeeeettttaaaa----cccchhhhaaaarrrrssss::::
           . - match any character.
           * - match 0 or more occurrences of pervious char.
           + - match 1 or more occurrences of pervious char.
           ^ - match at beginning of string.
           $ - match end of string.
           [ - start of character class.
           ] - end of character class.
           ( - start of a new pattern.
           ) - end of a new pattern.
           @(n)c - match <c> at column <n>.



SunOS 5.5           Last change: Apr 12 1995                    2






tgrep(1)                  User Commands                  tgrep(1)



           | - match either pattern.
           \ - escape any special characters.
           \c - escape any special characters.
           \o - turn on any special characters.

     To use the "or" operator, i.e.
     tgrep -e '(pat1)|(pat2)' file ...
     And you can have up to 10 -e options  on  the  same  command
     line.


EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
     TTTTGGGGLLLLIIIIMMMMIIIITTTT Set the maximum number of threads tgrep  will  start
     at  any  one  time.  This will limit the amount of resources
     tgrep will use on the system. TGLIMIT is ignored if  the  -B
     option is NOT set on the command line.


FFFFIIIILLLLEEEESSSS
     NONE


NNNNOOOOTTTTEEEESSSS
DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
     Some of the "grep like" options do not behave  exactly  like
     grep(1). This is why they are called "grep like".


EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
     To search all files from the current directory down, for the
     target string foobar run:

     tgrep foobar

     To search all files from the current directory down, for the
     target strings foobar or bizbar run:

     tgrep -e '(foobar)|(bizbar)'
     or
     tgrep -e 'foobar' -e 'bizbar' .

     To search all README files in the current directory and  all
     sub-directories for the strings boobar or foobar run:

     tgrep -p '^README$' -e '[bf]oobar'

     If the "$" char was omitted from the -p  option,  then  file
     names  like  README.first,  READMENOW,  etc  would  also  be
     searched.

     To search all man page directories for a string  of  foobar,
     run:



SunOS 5.5           Last change: Apr 12 1995                    3






tgrep(1)                  User Commands                  tgrep(1)



     tgrep foobar /usr/man /usr/local/man /opt/man

     To search for the continued line SRC= in  all  Makefile  (or
     makefile,  makefile.master,  etc) from the current directory
     and down, run:

     tgrep -p '^[Mm]akefile' -C -e '^SRC.*='

     The above command would find and  display  lines  that  look
     like:

     SRC = \
            foobar.c \
            main.c \
            lastfile.c


AAAAUUUUTTTTHHHHOOOORRRR
     Ron Winacott   Email : Ron.Winacott@Canada.sun.com




































SunOS 5.5           Last change: Apr 12 1995                    4



