From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7115 invoked by alias); 29 Mar 2015 00:10:11 -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: 34811 Received: (qmail 21442 invoked from network); 29 Mar 2015 00:10:00 -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: <551742D2.6090104@gmx.com> Date: Sat, 28 Mar 2015 20:09:54 -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: "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> <551738D8.805@gmx.com> <5441381427587060@web10j.yandex.ru> In-Reply-To: <5441381427587060@web10j.yandex.ru> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:SU+7uzEaNTUcpJBdBzYqJ9zFySUl0D8dKQ5aR7FROCRBxcd/weV 6LBEuyKKaK/9lZd6fj+WCm35gdfoXuI7AOixMME/FiZu+mgrGxCsJR+u35hb6vSRke8+MrB LXwa+rd0xPnObm+u22wnBIiDDYwb3KR7xSzw0MzaO1/33hIVFKmZOytDYt5zd1D0cZ8n0Gh 9m9xYxoizTfuLvN7DzMew== X-UI-Out-Filterresults: notjunk:1; On 03/28/2015 07:57 PM, ZyX wrote: > There is also another consideration: POSIX does not define `[[`. So > when you run an emulation mode *what exactly* should `[[` do? When > emulating `bash` (not present for some reason) or `ksh` this is > defined by those shells, but `sh` is clearly not a bash emulation > (reasoning: BASH_REMATCH is not set) and not ksh emulation (reasoning: > `emulate ksh` is a distinct emulation mode and `sh` emulation mode is > not referenced as an alias of `ksh` emulation mode). I have failed to > find what zsh developers meant by `sh` emulation exactly though: it is > not explicitly said that it emulates POSIX shell. But since it not > bash or ksh emulation mode `[[ $w ]]` in the above case should be > `false` (busybox emulation) or a command-not-found error (posh or dash > emulation). >>From my understanding of emulate, it works similar to bash's posix mode. Changing anything that conflicts with the mode, but doesn't disable other non-conflicting extensions. Distros like Arch Linux relies on it to source their /etc/profile from the global zprofile is more sh like environment. (with the added perk of stuff like [[ working.) I've also been using it for stuff like that for a long time and would appreciate it staying the way it currently is.