bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep.... I know I am new to ubuntu but....


From: John Cowan
Subject: Re: grep.... I know I am new to ubuntu but....
Date: Thu, 9 Feb 2012 03:51:25 -0500
User-agent: Mutt/1.5.18 (2008-05-17)

Bob Proulx scripsit:

> Of course everything you said was absolutely correct.  I hated to rain
> on it, and am trying not to, but wanted to get the information about
> "{} +" out.  Try it for 30 days and you will never go back! :-)

I'm aware of this extension to classic find syntax.  However, I still
like to use xargs because it allows pipelines to be generalized like this:

    find some/path | grep 'some.*regex' | xargs -d'\n' grep 'some-string'

which lets you select pathnames according to an arbitrary regex and then
grep exactly those files.  This allows searches which can't easily be
expressed by arguments to 'find', and is reasonably efficient provided
the subtree under some/path isn't too large.  The -d argument to xargs
forces it to treat only newlines as pathname delimiters, though if you
have filenames with newlines in their names (Ghu forbid) you'll still
have problems.

-- 
Yes, chili in the eye is bad, but so is your    John Cowan
ear.  However, I would suggest you wash your    address@hidden
hands thoroughly before going to the toilet.    http://www.ccil.org/~cowan
        --gadicath



reply via email to

[Prev in Thread] Current Thread [Next in Thread]