On 2005-12-11 14:33:54 +0100, Jérôme Marant wrote:
> The "then" keyword is being colored differently because you forgot the
> ";" after "]]".

I didn't forget it since the ";" is useless after "]]". "[[ ... ]]"
is a special syntax recognized by zsh, with its own rules (patterns
inside "[[ ... ]]" are handled differently and so on). But note that
this is not the case of "[ ...", as "[" is a normal command (though
also implemented as a builtin).

For instance:

prunille% if [[ a = a* ]] then
then> echo OK
then> fi
OK
prunille%

But:

prunille% if [ a = a* ] then
if> [Ctrl-C]

Here the ";" is necessary...

prunille% if [ a = a* ]; then
then> echo OK
then> fi
prunille%

And one can also see that "OK" is not written, unlike with "[[ ... ]]".

-- 
Vincent Lefèvre <[EMAIL PROTECTED]> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to