How to Write grep in Emacs Lisp (tutorial)

Rob Warnock rpw3 at rpw3.org
Thu Feb 10 04:47:20 CET 2011


Harald Hanche-Olsen  <hanche at math.ntnu.no> wrote:
+---------------
| [Icarus Sparry <i.sparry+un at gmail.com>]
| > The 'modern' way to do this is
| > find . -maxdepth 2 -name '*.html' -exec grep whatever {} +
| 
| Actually, I think it should be
|   find . -maxdepth 2 -name '*.html' -exec grep whatever /dev/null {} + \;
| because grep behaves differently when given only one filename as opposed
| to several.
+---------------

Oh, wow! I just learned from this thread about the new (to me)
"{} +" option to "find"! That wasn't in "find" until relatively
recently, it seems. [At least, it wasn't in FreeBSD 4.6, though
it seems to be in FreeBSD 6.x and later...]

Thanks, guys!!


-Rob

-----
Rob Warnock			<rpw3 at rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607




More information about the Python-list mailing list