in reply to Private Utilities

That's similar in utility to something I spoke about in the CB awhile back, bart said he'd like it and I started but haven't finished... It was aplopos, an apropos for your installed module base.

I have this, quotemeta for pipes e.g; find -name *.pl | quotemeta | xargs grep foo

#perl -p s/([ '"$*?()\[\]])/\\$1/g;
And this icky URIgrep:
#perl -l -O777 $_=<>;while(m/(\w+:\/\/[-a-zA-Z0-9\$_.+!*'(),?\/\%\&=~:]+)/g){print$1; +}

--
In Bob We Trust, All Others Bring Data.

Replies are listed 'Best First'.
Re^2: Private Utilities
by Eimi Metamorphoumai (Deacon) on Dec 01, 2005 at 00:59 UTC
    I can see some uses for your quotemeta for pipes, but the use you mentioned is more easily written as
    find -name \*.pl -print0 | xargs -0 grep foo
    which has the advantage of quoting all nasty filename characters (for instance, new lines, tabs, etc).
      Except that not all finds and xargss have this feature. The ones included with Solaris, for example.

      thor

      The only easy day was yesterday

      If you have newlines in your filenames you've issues IMHO. As for "more easily" well, I don't find your idiom particularly intuitive (it relies upon two arcane swtiches and you're sort of repeating yourself). Besides, I don't use the tool as much as I could because it always slips my mind, the more I use it the more I'll use it :-P

      It's interesting to know there's an option, maybe I'll include some variant as the default when I get around to writing the trivial wrapper that accepts arguments in the right order. POSIX be damned, find is grep-ing the filesystem and it ought to be find EXPR PATH

      --
      In Bob We Trust, All Others Bring Data.