It’s an old plan9 mailing list post, in which someone deconstructs find, and rebuilds it into something more modular, flexible, and powerful, and still compact enough to include the c and shell source code.

It needs to be a full blown Awk-like language, with -v name=value for passing parameters. I don’t think there’s any other way to subsume all of its functionality with command line flags. It’s already a huge abuse of the command line syntax. Both operators like -a and actions like -printf look the same, and neither of them are what flags usually mean (options passed to a program). This is confusing.

It already it as a pattern/action or predicate/action language, just with a bad syntax.

In fact it would be pretty easy to add this to an existing Awk codebase. You just add a simple tree walk function that exposes file system metadata to the boolean evaluator and action executor. If anyone wants to work on this in Oil [1] let me know :)

The suggestion later in the thread to use du instead seems odd to me. That’s some Plan 9 shenanigans there.

I love find but it definitely is a pain to work with. walk looks a lot nicer, although with Subversion I definitely need a prune ability that is better than grepping out the results post-facto. find’s prune is insane though.

Sor (Stream OR, get it?) is an rc script that reads a set of filenames from
it’s input, and applies a set of tests to them, echoing those names that pass
a test, discarding the rest.

I’m not too familiar with rc, but it looks like the script executes the given
command once for each input line. I couldn’t get the script to run here.
Therefore I use an equivalent script in sh instead to perform some quick tests
on a Subversion checkout of the FreeBSD ports tree. The times given below are
the ones towards which the commands converged after numerous runs.

First only find is used to find all the regular files inside the ports tree.

It’s basically as fast as the regular find version and demonstrates that it’s
possible to move the application of the predicates to the filenames into a
separate command in the pipeline while maintaining good performance. It nicely avoids naively spawning a new process for every input line.