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

Re: Short `if'



Peter Stephenson wrote:

> I can't get the short form of `if' to work, described in the manual as:
> 
>   if LIST SUBLIST
>        A short form of the alternate `if'.
> 
> What am I doing wrong?  I don't need it, I just need the code, manual and
> tests to be consistent.
> 
> % setopt shortloops 
> % if true; print hello
> if> ^C
> % if true { print hello }          # didn't expect this to work
> zsh: parse error near `}'
> 14:55% if true; { print hello }    # shouldn't be dependent on shortloops(?)
> if> ^C

That's very peculiar.  I don't know either, but

  % if [[ -n x ]] echo hello

works.


Bye
  Sven


-- 
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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