From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29652 invoked by alias); 4 Mar 2015 15:03:28 -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: 19968 Received: (qmail 1435 invoked from network); 4 Mar 2015 15:03:24 -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=0.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_PCNT autolearn=no version=3.3.2 Date: Wed, 4 Mar 2015 16:03:23 +0100 From: Vincent Lefevre To: zsh-users@zsh.org Subject: Re: grammar triviality with '&&' Message-ID: <20150304150323.GC25170@ypig.lip.ens-lyon.fr> Mail-Followup-To: zsh-users@zsh.org References: <20150302022754.GA7449@xvii.vinc17.org> <54F3E489.5050603@eastlink.ca> <54F48D26.6040303@eastlink.ca> <3716401425322991@web19h.yandex.ru> <2721791425356115@web16g.yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.23-6424-vl-r76280 (2015-02-19) On 2015-03-02 20:43:27 -0800, Kurtis Rader wrote: > On Mon, Mar 2, 2015 at 8:15 PM, ZyX wrote: > > > > I do not think this is a mistake. And I found at least two differences: > > > > 1. `command test --help` returns zero, `command \[ --help` displays help. > > 2. `[` requires `]` (unless it received `--help` or `--version`), no > > matter what name it is called with, `test` requires not. > > > > Note that coreutils ebuild does *not* contain any references to `test` or > > `[`, patches as well do not (except when Makefile is patched not to > > regenerate man pages). This means that this difference is created by GNU > > developers, *not* by distro maintainers. > > > > Ugh! I can confirm your observations using my Ubuntu 14.04 server. Yet on > Mac OS X Yosemite the two names are linked to the same binary. Mac OS X > exhibits the traditional behavior. I have no idea why GNU based distros > have the two names linked to slightly differently behaving binaries. Having different behaviors is required by POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html However you do not need different binaries to get different behaviors: the binary could look at argv[0] to know how to behave. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)