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.
Indeed, the original purpose of a signal was to kill the target process. kill
appeared in Unix 3rd Edition; at the time, it was reserved to root and the process was forcibly killed (like SIGKILL today) and left a core dump.
Unix 4th edition added a signal number argument, as well as the companion signal
system call to set a signal handler. At the time, all signals killed the target process unless the target process had called ignore
.
Over time, more and more signals appeared, a few of which did not kill the target process by default. But the name remained.
The POSIX committee debated renaming kill
, because as you note not all signals are intended to terminate the target process, but this was entrenched historical usage by that point, so changing it would have been more confusing than not.
Best Answer
It's due to the technical constraints of the time. The POSIX standard was created in the 1980s and referred to UNIX, which was born in the 1970. Several C compilers at that time were limited to identifiers that were 6 or 8 characters long, so that settled the standard for the length of variable and function names.
Related questions: