Back in the day, I wrote two commands: walk and sor. Walk was
somewhat similar to Russ's lsr command (these days, lsr would probably
be better; the only additional thing walk offered was the ability to
limit the depth of searching via an option). Sor took other commands
as arguments; for each filename that it read (presumably generated by
walk), it would apply each test successively; if one returned `true'
it would print out the resulting filename. (sor, incidentally, stands
for `stream or').
The idea behind find, when you step back a little bit, is to produce
some list of files (or otherwise do something interesting with them)
after applying a set of predicates to them. The predicates can be
strung together into aribrary sequences that form filters based on the
boolean value of evaluating the predicates for each file that find
visits. Well, in Plan 9, we form filters that reduce lists using
pipes, and sor was just a convenient way to compute the boolean or of
a bunch of predicate evaluations. It worked out, I thought,
reasonably well, but never made it into the distribution; I guess no
one else saw the point. But, if you search through the 9fans
archives, you can probably find the tools (and they're in my contrib
directory on sources). I still thing it's mostly an improvement.
- Dan C.
Post by Kim ShrierThis is probably me just stuck in the UNIX mind set again. I have
looked through the commands and I don't see anything that does what
find does. What I am trying to do is look in a directory that has
many files and subdirectories and find any file that contains a string.
In UNIX, I would do something like this.
find . -type f -exec grep some_pattern {} \; -print
What is the Plan 9 way?
Thanks,
Kim