


MATCH(1L)            Schily's USER COMMANDS             MATCH(1L)



NNNNAAAAMMMMEEEE
     match - searches for patterns in files

SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
     mmmmaaaattttcccchhhh [ -_o_p_t_i_o_n ] _p_a_t_t_e_r_n [ _f_i_l_e ... ]

DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
     _M_a_t_c_h searches the named files  or  standard  input  (if  no
     filenames  are  given) for the occurrences of the given pat-
     tern on each line.  The program accepts  literal  characters
     or  special  pattern  matching  characters.   All lines that
     match the pattern are output on standard  output.   You  can
     only specify one pattern string for each match, however, you
     can construct an arbitrarily complex string.   When  you  do
     not specify a file, match can be used as a filter to display
     desired lines.  Standard in is used if no files  are  speci-
     fied.

OOOOPPPPTTTTIIIIOOOONNNNSSSS
     ----nnnnooootttt, ----vvvv
          Prints all lines that do not match.

     ----iiii    Ignore the case of letters

     ----mmmm    Force not to use the magic mode

     ----wwww    Search for _p_a_t_t_e_r_n as a word

     ----xxxx    Display only those lines which match exactly

     ----cccc    Display matching count for each file

     ----llll    Display name of each file which matches

     ----ssss    Be silent indicate match in exit code

     ----hhhh    Do not display filenames

     ----nnnn    Precede matching lines with line number (with  respect
          to the input file)

     ----bbbb    Precede matching lines with block number

RRRREEEEGGGGUUUULLLLAAAARRRR EEEEXXXXPPPPRRRREEEESSSSSSSSIIIIOOOONNNNSSSS
     The following is a table of all the pattern matching charac-
     ters:

     _c    An ordinary character (_n_o_t one of the  special  charac-
          ters  discussed  below)  is  a  one  character  regular
          expression that matches that character.

     \\\\_c   A backslash (\) followed by any special character is  a



Joerg Schilling    Last change: 15. Juli 1988                   1






MATCH(1L)            Schily's USER COMMANDS             MATCH(1L)



          one  character regular expression that matches the spe-
          cial character itself. The special characters are:

          ! # % * { } [ ] \ ? ^ $

     !!!!    Logical OOOORRRR as in  match  _t_h_i_s!_t_h_a_t!_t_h_e__o_t_h_e_r.  You  may
          have to use `{}' for precedence grouping.

     ####    A hash mark followed by any regular expression  matches
          any  number (including zero) occurrences of the regular
          expression.

     ????    Matches exactly any one character.  WWWW???? matches _W_a,  _W_b,
          _W_c, _W_1, _W_2, _W_3 ...

     ****    Matches any number of any character.

     %%%%    Matches exactly nothing. It can be used  in  groups  of
          ored  patterns  to specify that an empty alternative is
          possible.

     {{{{}}}}   Curly brackets may  be  used  to  enclose  patterns  to
          specify  a  precedence  grouping,  and  may  be nested.
          {{{{%%%%!!!!{{{{tttteeeesssstttt}}}}}}}}vvvveeeerrrrssssiiiioooonnnn matches the strings  _t_e_s_t_v_e_r_s_i_o_n  and
          _v_e_r_s_i_o_n.

     [[[[_s_t_r_i_n_g]]]]
          A non empty string of  characters  enclosed  in  square
          brackets  is  a  one  character regular expression that
          matches _a_n_y _o_n_e character in that string.   If  however
          the  first character of the string is a circumflex (^),
          the one  character  expression  matches  any  character
          which  is  _n_o_t  in  the  string. The ^ has this special
          meaning _o_n_l_y if it occurs  first  in  the  string.  The
          minus  ( -) may be used to indicate a range of consecu-
          tive ASCII characters; for example, [0-9] is equivalent
          to  _a_n_y  _o_n_e  _o_f  _t_h_e  _d_i_g_i_t_s. The - loses it's special
          meaning if it occurs first (after an initial ^, if any)
          or  last  in  the string.  The right square bracket (])
          and the backslash (\) must be quoted with  a  backslash
          if you want to use it within the _s_t_r_i_n_g.

     ^^^^    Matches the beginning of a line.

     $$$$    Matches the end of a  line.  (^*$  matches  any  entire
          line)

EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
FFFFIIIILLLLEEEESSSS
     None.





Joerg Schilling    Last change: 15. Juli 1988                   2






MATCH(1L)            Schily's USER COMMANDS             MATCH(1L)



SSSSEEEEEEEE AAAALLLLSSSSOOOO
     grep(1), fgrep(1), egrep(1)

DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
NNNNOOOOTTTTEEEESSSS
     Even if a match occurs more than once per line, the line  is
     output only once.

     Quote special pattern matching characters  to  prevent  them
     from being expanded by the Command Interpreter.

BBBBUUUUGGGGSSSS
     The length of the pattern is currently limited to 100  char-
     acters.

     This limit is reduced by 38 if the ----wwww option is used.







































Joerg Schilling    Last change: 15. Juli 1988                   3



