On 5/23/07, Marek Bernat <marek.bernat_AT_gmail.com> wrote:
> On 5/23/07, Sander van Dijk <a.h.vandijk_AT_gmail.com> wrote:
> >
> > And the emacs comparison isn't nonsensical, it's just an exaggeration;
> > one could argue to builtin emacs with the exact same arguments as
> > mainly used for "test" and "[".
>
> No. You can call test from a script 1000 times a second. There's a need for
> officiency. You only run emacs once.
> The line between the two is clear. test/[ is a language construct, so it's
> natural to be inside the language itself.
> As for emacs, well, I don't it is a part of the shell ;-)
He, I don't even want emacs on my machine at all ;-)
As for test being a language contruct: is isn't, or at least wasn't
originally. "if" checks what the return value of the call following it
is; in case it is zero, it does something, otherwise it does something
else. For example,
if sleep 1
then
echo successfully slept for one second
else
echo something went wrong while sleeping
fi
is just as valid a statement as an "if test blahblah" statement.
Originally, test was just a program that was quite (and pretty much
only) useful in conjunction with sh(1)'s "if" builtin. Whatever the
argument for building it into current shells, test is not a real part
of the sh(1) language.
Greetings, Sander.
Received on Wed May 23 2007 - 17:53:29 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:42:31 UTC