Note that POSIX find does support options like other commands, and --
to mark the end of them like other commands. Those are -H
and -L
.
The -print
, -type
... are not options, they're sometimes called predicates. They are arguments whose order matters that appear after the file paths which themselves appear after the options. You've also got (
and !
. Together, they build an expression that is used to determine what files to find.
find
is not the only one. [
(aka test
) and expr
are other commands whose arguments are used to build an expression.
Like find
, [
has operators that start with -
and are more than one-letter (-gt
, -eq
...).
Like find
, test
has issues where those operators may be confused with operands.
find -- "$file1" "$file2" -type f
[ -f "$file1" -a -f "$file2" ]
If $file2
is !
, it's a problem with find
. If it's =
, it's a problem with (some) [
.
For all of find
, test
and expr
, using options to build the expression would not really have worked. Another option could have been to have one string evaluated as the expression like awk
or sed
. like for
find f1 f2 \( -type f -mtime -1 -o ! -type f -newer x \) -exec ls -ld {} +
Do:
find 'found = 0
if (typeof($f) == "f") {
if (age($f) > 1) found=1
} else if (age($f) < age("x")) found = 1
if ($found) exec_multi("ls -ld {}")' f1 f2
But that means implementing a grammar parser in find
. That also means potential quoting nightmare for the "x"
and command line above.
Actually AT&T Research did come up with such a command: tw (tree walker), but even though it's now open source, I'm not aware that it is really used out of AT&T.
I found this paragraph in a withdrawal letter for FIPS which might be why it was withdrawn:
excerpt from withdrawal letter
It is no longer necessary for the government to mandate standards
that duplicate industry standards. Federal government departments and
agencies are directed by the National Technology Transfer and
Advancement Act of 1995 (P.L. 104-113), to use technical industry
standards that are developed in voluntary consensus standards bodies.
There is also this letter/email:
From: "richard l. hogan"
<Richard=L.=Hogan%dpi%hqnmd@mcmcban6.er.usgs.gov> Date: Tue, 29 Oct
96 9:20:26 CST Subject: Withdrawal of FIPS
Which discusses that the NIST and the Dept. of Commerce were dropping national designations for things such as ANSI 3.64 when they already had a international designation (ISO).
excerpt from that letter/email
One of the pieces of legislation that, according to NIST and the
Department of Commerce, enabled the FIPS program was rescinded this
year. The law - sometimes referred to as the Brooks Act - contained
specific requirements for establishing uniform standards for
information processing in the Federal government and for making those
standards mandatory in Federal procurement actions. OMB Circular A-119
further clarified that mandatory Federal standards took precedence
over voluntary national and international standards. Now, as a result
of treaty negotiations making the Untied States part of the World
Trade Organization, the Books Act has been replaced with new
legislation that requires Federal agencies to consider voluntary
international and national standards FIRST in procurement actions and
to cite Federal standards only when no appropriate international or
national standards exist.
In many cases FIPS have international (ISO) or national (ANSI)
standard equivalents. For example, FIPS 123 (Data Descriptive Format
for Information Interchange) is also ISO-8211. The change in
legislation requires Federal procurements to now cite ISO-8211.
Previously, we were required to cite FIPS- 123. As a result of this
change, NIST has recognized an opportunity to make government "work
better and cost less" by withdrawing any FIPS that already has an
equivalent ANSI or ISO specification or any FIPS that is not
mandatory; i.e., is just a guideline. What remains on the "active"
FIPS list are mandatory Federal standards which currently have no ANSI
or ISO equivalent; for example, the Spatial Data Transfer Standard
(FIPS 173-1) and the Government Information Locator Service (FIPS
192).
NIST is not withdrawing important standards like Pascal, FIPS 109;
SGML, FIPS 152; or Hydrologic Unit Codes, FIPS 103. The proper way to
look at this action is that NIST is withdrawing the Federal
designation of these standards in favor or their national or
international standards designations; ANSI X3.97-1993 for FIPS 103,
ISO 8879 for FIPS 152, and ANSI X3.145-1986 for FIPS 103. From a user
point of view, this action by NIST is nothing more than a way to
assure the designation change required by the new legislation.
I would interpret this as follows: Since ECMA-48 already covered the standard at an international level there was no need to create redundant standards within ANSI.
Best Answer
I seem to have hit paydirt here. I searched the "usual haunts" and found nada, then thought, hey, where in the good 'ole days would *NIX freaks post about this stuff?
Usenet. They would post on Usenet. On April 30, 2002, Casey Schauffler wrote: