Thread (1 message) 1 message, 1 author, 2021-10-07

Re: [PATCH] p3400: stop using tac(1)

From: Junio C Hamano <hidden>
Date: 2021-10-07 23:44:10

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 ;-)

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help