Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: "[[" (Re: PATCH: _urls again (Re: setopt localoptions noautoremoveslash))



Bart Schaefer wrote:

> PWS says in http://www.ifh.de/~pws/computing/zshguide02.html#l6
> 
>     Second aside for users of sh: you may remember that tests in sh used
>     a single pair of brackets, `if [ ... ]; then ...', or equivalently
>     as a command called test, `if test ...; then ...'. The Korn shell
>     was deliberately made to be different, and zsh follows that. The
>     reason is that `[[' is treated specially, which allows the shell to
>     do some extra checks and allows more natural syntax.

Here on zsh-workers we could probably say what the real difference is: 
the parser knows about `[[ .. ]]' which should allow for faster
execution (I guess this is what Peter meant by `treated specially').
`[ .. ]' can only be handled as a normal builtin.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author