Good afternoon,
On 24/10/14 at 4:37 AM -0700, [email protected] wrote:
I can't get it working with the -f parameter, nothing is
returned, but if I put regex inline then it is ok.
As Dave pointed out; that might be due to different version of
grep; read the docco at the link he supplied (assuming you have
current OS).
I think it is probably better to go the applescript route.
Not if you want the search to actually finish while you're still
at work. Really, you could not have described grep any better;
it's the tool you want; re-inventing a perfectly good tool makes
no sense.
I am actually using BBEdit v11 on x.10 but had a similar problem on
mavericks. The simple multi file find can probably be scripted to
repeat itself, I had initially tried using process lines containing ...
but this deletes all the non matching.
Sure it can be scripted. But will take much longer to write that
script, and will take **MUCH** longer to run that script. The
time it takes you to read the grep docco will be less than the
time it takes to re-invent grep.
I do have some basic perl knowledge so may be able to do it
using that instead, passing the files in as parameters, but
they are in different nested folders.
Yep, Perl is much better suited (close to its original design
purpose), but it's still not needed. It's overkill for the
described problem. Of course, the real problem may be different
than the described problem, in which case my suggestions could
be very wrong.
Combine grep with xargs, and I'd be *VERY* surprised if you need
any scripting at all. Eg. the need to delete matched files
(discussed earlier) would simply be:
grep -R -l "find this string" in/this/path/ | xargs rm
That command WILL delete all matched files (so be careful);
should be interactive though, the following will force delete:
grep -R -l "find this string" in/this/path/ | xargs rm -f
BTW, how do I get commands to run in the Unix worksheet, cmd
enter does not do anything ? (I need to RTFM).
Yep, RTFM, cmd-enter does not do anything. Just press enter.
Charlie
--
Charlie Garrison <[email protected]>
github.com/cngarrison metacpan.org/author/CNG
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].