From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1791 invoked by alias); 10 Apr 2015 03:00:03 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20125 Received: (qmail 14166 invoked from network); 10 Apr 2015 03:00:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=X398TAQtsU80046tw718OnjbWmXN5hyvusaFTRcCUjo=; b=ULEdcnGChTAHCkPIV4gxhJLt4YEeOAouFRgp4+0WmCwcMU6C6DNRrw4UDPJPaYHvO9 fBDiz4FbuPtRdZqYJECrUCKdwaCY/NkxH5ariKox1tW6wUCrT4HU64bpmtseuz1fTMde +cZ5RmN4T3+LAuzz4XlNapODHrwmlK5PslGF4UbpE+r4da3I9CtXqHXjGJN9vbvTYMM0 Z4MUYSUPjD4apj6xLVfyzbIbWAEsnUASGRPTgLb+9YEWlAd6KdnatVMvnf/fHdfadPLU /jnwY4ZH9AUATcXN+gx3fh2fFJ8e4ZUZRMAuvLGrQRnb6URP3uTjGdqldaBUoroopwyx ICFw== X-Gm-Message-State: ALoCoQmxUaWbxW3oO5swZo91DusAwFz4EYfGg+9k1X0o57SnyMf6j+Mt88vi/2uhcwSydOv6RcB4 MIME-Version: 1.0 X-Received: by 10.112.204.199 with SMTP id la7mr10862518lbc.114.1428634796993; Thu, 09 Apr 2015 19:59:56 -0700 (PDT) In-Reply-To: References: Date: Thu, 9 Apr 2015 19:59:56 -0700 Message-ID: Subject: Re: `[[ -n $VAR ]]` equal to `[[ $VAR ]]`? From: Kurtis Rader To: Mikael Magnusson Cc: Thorsten Kampe , Zsh Users Content-Type: multipart/alternative; boundary=001a11c3bb3096c12b051355f537 --001a11c3bb3096c12b051355f537 Content-Type: text/plain; charset=UTF-8 On Thu, Apr 9, 2015 at 7:46 PM, Mikael Magnusson wrote: > (please don't top post, it's a lot of work to fix the mail before replying) > Please don't lecture others. I hate top posting. I'm 54 and hated the rising popularity of programs like Outlook which encouraged top posting. Gmail makes top posting the default. So unless I'm responding to more than a single point in the original message I take the path of least resistance. We lost the battle of top versus bottom posting twenty years ago. Move on. > If you mean ambiguity because VAR might be the string "-z" for > example, there is no such ambiguity. The syntax of [[ ... ]] is fully > parsed before any substitutions inside are made (I think, but it's at > least true for this purpose). (This is unlike [ ... ] which is not > syntax but a shell builtin that gets passed arguments after they're > substituted, globbed, expanded and etc). > No, I mean ambiguous in the sense that a naive reader of the script might wonder what the author intended. Really, there's no good reason to save a couple of characters in this situation. Be explicit about what you intend to avoid confusion. -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank --001a11c3bb3096c12b051355f537--