Email List: Xaustin-group-lX
[All Lists]

Re: find + xargs

To: yyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Re: find + xargs
From: Tom Lord <yyyy@xxxxxxx>
Date: Sun, 25 Mar 2001 09:58:15 -0800 (PST)
About print0, +, and other extensions to find, sort, etc.

Traditionally, text and file utilities are small and simple (almost
as if they were designed to run on very small machines and be maintained
using line editors).  That's a virtue: they are small enough to reimplement;
they become more and more useful as machines get bigger;  they are 
(compared to many other programs) easy to implement with perfect accuracy
(although, it seems, few people actually bother); they are easy to 
thoroughly understand.

It is also true that the standard utilities have poorly designed
command line interfaces, and input and output formats: they are
inconsistent in several ways and, as the case of filenames with
special characters illustrates, not fully general.  So what should a
standards group do about this?

The approach advocated here recently is to identifiy a specific usage
limitation (funny file names), and existing implementations with a 
work-around (GNU -print0, for example), and propose standardizing that 
work-around.

Abstractly, that's a fine approach, but in its particulars, it has
problems.  The proposed solutions (-print0 and complementary sort
options, xargs built-in to find) solve the specific usage limitation
but do not make the programs in question fully general.  They may
permit funny filenames with some shell idioms, but they still leave us
tools with problematic input and output formats.  (For example, what if 
I want to sort strings that might contain any code point at all?)
Worse, in exchange for almost-but-not-quite repairing the design of
the tools, they add complexity and bloat.  And worse still, this
approach promises additional complexity and bloat in the future,
when further work-arounds are added to cover the next round of
usage limitations.

So the situation is that the standard functionality has problems and
the contemporary implementations have inadequate solutions.  What
should a standards body do?  Leave the standards as they are until
clearly excellent solutions are found.

What should vendors do who have a practical need for, for example,
a version of find that can handle the funny filenames created by
this or that desktop environment?  Design and build completely new tools
and seek their adoption through, for example, the release of Free Software
implementations.  And while you're at it, how about making the old
tools accurately implement the existing standards?  That'd be a refreshing
change.

Thomas Lord

<Prev in Thread] Current Thread [Next in Thread>