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

Re: [[ ... ]], [ ... ], bash, zsh



Haakon Riiser <haakon.riiser@xxxxxxxxxx> writes:

> In both bash and zsh, the "-n" operator in [ ... ] is optional, but in
> [[ ... ]] it's only optional in bash.  Is there a reason for this?

If you use [ ], the test is supposed to work like with test(1). In the
case of zsh this is still handled by a built-in, I don't know how it is
with bash. The [[ syntax is a shell-specific extension, and there are
several differences between the shells on how the are interpreted.



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