zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: Incorporating (( $+commands[foo] )) into a larger "if" statement
Date: Thu, 6 Aug 2015 07:57:28 -0700	[thread overview]
Message-ID: <150806075728.ZM19287@torch.brasslantern.com> (raw)
In-Reply-To: <55C2F65F.50807@necoro.eu>

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.


  reply	other threads:[~2015-08-06 14:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05 22:00 TJ Luoma
2015-08-06  1:57 ` Bart Schaefer
2015-08-06  5:53 ` id5
2015-08-06 14:57   ` Bart Schaefer [this message]
2015-08-06 20:59     ` René Neumann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150806075728.ZM19287@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).