Zsh Mailing List Archive
Messages sorted by:
Re: `[[ -n $VAR ]]` equal to `[[ $VAR ]]`?
- X-seq: zsh-users 20125
- From: Kurtis Rader <krader@xxxxxxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Subject: Re: `[[ -n $VAR ]]` equal to `[[ $VAR ]]`?
- Date: Thu, 9 Apr 2015 19:59:56 -0700
- Cc: Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CAHYJk3Qj6W=VZ26si0VjhsmS1u9go6mVGpXjDSTLk5knKaEtOg@mail.gmail.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <firstname.lastname@example.org> <CABx2=D-VTpp3ihAE_A2KCdE3tcPu5RPuB8WJwtv-G=B0QNx0GQ@mail.gmail.com> <email@example.com> <CABx2=D9Mk01ovQkMyWT_1nh9WdDvcpqmMJAOdka-oEmN8Xe4nw@mail.gmail.com> <CABx2=D93rJDoqGHa=9=nGZZU=9oC_vc-0FHE8ZERV9LmxtqRaA@mail.gmail.com> <CAHYJk3Qj6W=VZ26si0VjhsmS1u9go6mVGpXjDSTLk5knKaEtOg@mail.gmail.com>
On Thu, Apr 9, 2015 at 7:46 PM, Mikael Magnusson <mikachu@xxxxxxxxx> 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.
Caretaker of the exceptional canines Junior and Hank
Messages sorted by: