René Scharfe [off-list ref] writes:
In my mind, test is an external command. Wikipedia [1] says it has been
a builtin since the early 80ies, and I couldn't find a shell without it.
I wonder where I picked up that outdated assumption -- I'm not actually
_that_ old. Time for an update..
Funny, as I was wondering about the same thing the other day in a
totally different context.
Our older shell script (like tests) tends to strongly prefer "case
... esac" over "test" for this exact reason, e.g option parsing loop
often uses
while case $#,$1 in 0,*) break ;; *,-*) ;; *) break ;; esac
do
...
instead of
while test $# -gt 0 && ...
to avoid "test". I'm not actually _that_ old, either, but my
current suspicion is that those who traind us are old enough ;-)