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

Re: Incorporating (( $+commands[foo] )) into a larger "if" statement



On Aug 6,  7:53am, id5 wrote:
}
} if [[ (( $+commands[foo] )) && ... ]]; then
}   echo yes
} fi

That doesn't work.  [[ (( ... )) ]] is only parsed at all because you
are allowed to have parenthesized subexpressions inside [[ ]], it is
not interpreted as math in that context.

I suspect you meant

    if (( $+commands[foo] )) && [[ ... ]]; then


Aside:  You somehow posted your reply with "From: id5" (no domain name in
the email address).  You should fix that.



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