Re: how to search files by pattern?

From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 05/28/04


Date: Fri, 28 May 2004 17:36:38 -0400

In article <c97uct$iqq$1@mfdebug.isd.dp.ua>,
 "dmitry_kulinich" <dkul@isd.dp.ua> wrote:

> >find / -regex "<insert pattern here>" -type f > my_list_of_files_matching
> Great!...but if a pattern have 10 lines?

Grep works a line at a time, printing each line that matches the
pattern. A pattern that contains multiple lines will never match
anything.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


Relevant Pages

  • Re: grep and operator
    ... Subject: grep 'and operator' ... grep 'first pattern' and 'second pattern' foofile ... If BRP always appears at the beginning of the line, or rather, the BRP you ... record delimiter and so you may want to switch to awk where you can specify ...
    (comp.unix.sco.misc)
  • Re: Search & Replace
    ... Seems simple enough but I had to fiddle about for ages ... GREP box or not. ... but only if you include it in the pattern. ... TW's excellent colour-coded search and replace fields make it /relatively/ straightforward to spot special characters. ...
    (comp.sys.mac.apps)
  • Re: All the world seems in tune
    ... both of which use 2-byte pointers into the pattern, ... runs into this limit in grep, and sometimes it's a Real Pain In The ... I'm not going to rewrite it right away. ... fiber splicing kit for the tiny tots to have Fun with just like Daddy (but ...
    (alt.sysadmin.recovery)
  • Re: Different way of getting Standard input
    ... If there are entries in @ARGV (the variable that holds what ... (e.g. grep, wc, sort, etc). ... die "$0 needs a pattern to match with" unless @ARGV; ... cowens@amans:~$ perl grep.pl perl grep.pl ...
    (perl.beginners)
  • Re: stat and its exceptions
    ... match the pattern, ... Please read perldoc perlstyle. ... It's not in the FAQs, ... > I know the grep loads everything. ...
    (comp.lang.perl.misc)