🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #425

Re: The road not taken

#425
From: Dan Cross
Date: Fri, 27 Nov 2026 21:42
34 lines
2323 bytes
In article <slrn11gitnk.13qg.naddy@lorvorc.mips.inka.de>,
Christian Weisgerber  <naddy@mips.inka.de> wrote:
>On 2026-11-27, Lawrence D’Oliveiro <ldo@nz.invalid> wrote:
>
>>>>> Anyway, I took a peek at V6, and found this gem in the find(1) man
>>>>> page:
>>>>>
>>>>>        Syntax should be reconciled with _if_.
>>
>> So, the “road not taken” was really keeping them as external commands.
>
>Their operators weren't unified.  if(1), later test(1) -r/-w versus
>find(1) -perm, etc.

Years ago, on Plan 9 (which does not have a `find` command), I
had the epiphany that `find` was really just a series of filters
with one addition: an `or` operator.  I wrote something called,
`sor`, for "stream or", that took a series of "tests" as command
line arguments and applied each in turn to a series of strings
it read from stdin; it was assumed that each string named a
file, and the tests would probe characteristics of those files.
If any test succeeded, it emitted the string, otherwise it
didn't.

I wrote another little program called `walk` that just generated
a list of file names rooted at some set of directories (I think
I added a `-d` option to limit depth).  Between `walk`, `sor`,
the shell, and the usual complement of unix-y filters, I could
do pretty much whatever `find` could do.

It wasn't super fast, but it was a fun little exercise.

	- Dan C.
Technical Details
Message-ID: <11ectfu$9cv$1@reader2.panix.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
References: <slrn11gh1gh.eig.naddy@lorvorc.mips.inka.de> <slrn11ghiso.klm.naddy@lorvorc.mips.inka.de> <11eajar$16iu7$1@dont-email.me> <slrn11gitnk.13qg.naddy@lorvorc.mips.inka.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
From: cross@spitfire.i.gajendra.net (Dan Cross)
Newsgroups: comp.unix.shell
Subject: Re: The road not taken
Date: Fri, 27 Nov 2026 21:42:22 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <11ectfu$9cv$1@reader2.panix.com>
References: <slrn11gh1gh.eig.naddy@lorvorc.mips.inka.de> <slrn11ghiso.klm.naddy@lorvorc.mips.inka.de> <11eajar$16iu7$1@dont-email.me> <slrn11gitnk.13qg.naddy@lorvorc.mips.inka.de>
Injection-Date: Fri, 27 Nov 2026 21:42:22 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
	logging-data="9631"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: cross@spitfire.i.gajendra.net (Dan Cross)