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

Re: if (()){}else{} documented?



On Tue, Apr 20, 2021, at 10:40 AM, david wrote:
> Hi
> 
> I have been in a world of pain playing around with compound control 
> structures
> 
> e.g. this only works as a single line (is that true?)
> 
>   if (( $1 == 4 )) { echo good } else { echo bad }
> 
> just wondered where I could read up on this?

The zshmisc(1) man page, section "ALTERNATE FORMS FOR COMPLEX
COMMANDS".  It assumes familiarity with lists, so probably also
look at "SIMPLE COMMANDS & PIPELINES".

-- 
vq




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