From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7505 invoked by alias); 28 Mar 2015 23:27:30 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34809 Received: (qmail 4840 invoked from network); 28 Mar 2015 23:27:26 -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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Message-ID: <551738D8.805@gmx.com> Date: Sat, 28 Mar 2015 19:27:20 -0400 From: Eric Cook User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: ZyX , "zsh-workers@zsh.org" Subject: Re: [[ is being treated as a pattern in the command/reserved word position. References: <55171842.7030505@gmx.com> <150328144428.ZM5583@torch.brasslantern.com> <55172355.80409@gmx.com> <150328152430.ZM18574@torch.brasslantern.com> <6862591427582011@web25h.yandex.ru> <55173419.6070103@gmx.com> <6544501427584768@web10m.yandex.ru> In-Reply-To: <6544501427584768@web10m.yandex.ru> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:HOGP+UNKn4603ZalSdPV1b5pxrmyZK3y1LePbOHzVsGNR7eoC8E HJC/crlqotdlXKCnTbEhtFaWHeaffhHqx+Og1OMPwUsv0xzXnSNQykkrvNLIbPuqtF5tHD6 lgRRd7uBWi3/BuppUEvTcCv1OqkubzMDXf4aKDk709ltyKH29LF57kIWKAYzab1cJVCttZg tdLutFM7YmXfkcaG7fEGw== X-UI-Out-Filterresults: notjunk:1; On 03/28/2015 07:19 PM, ZyX wrote: > 29.03.2015, 02:07, "Eric Cook" > `[[` is a *syntax extension*. This *is* going against POSIX. If `[[` in POSIX emulation mode was implemented as a shell built-in in a manner that allows implementing it as a script your concern would be valid. But implementing `[[` as a shell built-in is breaking certain expectations about how `[[` is supposed to work. > > Specifically, with > > setopt SH_WORD_SPLIT > w="a = b" > test $w # False: a ≠ b, expected > [[ a = b ]] # False: a ≠ b, expected > [[ $w ]] # True: w is not empty, should be false if shell is POSIX > > . It is easier to disable `[[` then keep two implementations of it. See 2.4 of: http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html > The following words may be recognized as reserved words on some implementations (when none of the characters are quoted), causing unspecified results: > > [[ ]]functionselect