From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15504 invoked by alias); 4 Feb 2015 18:15:09 -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: 19812 Received: (qmail 26671 invoked from network); 4 Feb 2015 18:15:06 -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,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Authority-Analysis: v=2.1 cv=X+5rdgje c=1 sm=1 tr=0 a=f7zwPcoQMel2pEJwRS33iw==:117 a=f7zwPcoQMel2pEJwRS33iw==:17 a=Hpgzp-inWqAA:10 a=N659UExz7-8A:10 a=sMsNtz2JTEiNk-wT9BMA:9 a=pILNOxqGKmIA:10 Message-id: <54D25A02.1000605@eastlink.ca> Date: Wed, 04 Feb 2015 09:42:26 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: The "-" and "--" options (was Re: ${var:1:1:=y}) References: <54D155C8.4080600@eastlink.ca> <412544FB-49A2-43AA-BC76-DC1AF1AA71BE@larryv.me> <54D16A4C.9010609@eastlink.ca> <150203192508.ZM2159@torch.brasslantern.com> <54D195B2.4070205@gmx.com> <150204091014.ZM3216@torch.brasslantern.com> In-reply-to: <150204091014.ZM3216@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 02/04/2015 09:10 AM, Bart Schaefer wrote: > On Feb 3, 10:44pm, Eric Cook wrote: > } Subject: Re: ${var:1:1:=y} > } > } On 02/03/2015 10:25 PM, Bart Schaefer wrote: > } > All builtin commands other than precommand modifiers, even those that > } > have no options, can be given the argument `--' to terminate option > } > processing. [...] For historical reasons, > } > most builtin commands also recognize a single `-' in a separate word > } printf , test/[, set -A and maybe a few others are exceptions to those > } rules. > > Also "echo" does NOT accept "--" in this way, it ONLY acceps a solitary > "-". I forget why that is. > > printf : accepts -- but not - > test : accepts neither > set : the -A itself ends option processing, and "--" has added semantics I'm glad I've been disabused of any notion that consistency is something to be expected or even valued. Anyway it seems that this makes it difficult to echo a dash. I'd have guessed that single quoting the dash would work, but no luck, however: $ echo '- ' works, so that will do. >