From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29692 invoked by alias); 4 Feb 2015 23:47:22 -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: 19816 Received: (qmail 5848 invoked from network); 4 Feb 2015 23:47:19 -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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=larryv.me; h= x-sasl-enc:content-type:mime-version:subject:from:in-reply-to :date:cc:content-transfer-encoding:message-id:references:to; s= mesmtp; bh=ftQKMz38on9olHrO0TOCcBnTClc=; b=FC8cES9bLXR+YYsY4ACHo 3UfEPqiG6ljd6UshLdT5EPYHM6H87L4VP1BKkjPbELfgJfjN6rGvKs33VUNnBwTI dRR4dl97WBhT3r7CA/ov1Lf+mE+7n2XvMoCtobB26opm07rgmuTX77Smy2t2haVU uQyJgYhmgayRBBVHOe8AMc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:content-type:mime-version :subject:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to; s=smtpout; bh=ftQKMz38on9olHrO0TOCcBn TClc=; b=hxhl4kGp05cLfqjAi76u10SE5Gj9J46PypQz+EiYaBjvboq5vSe3Quk LoCAJlYe2vdHaAe/iPPMiiOxSEtUtnjrqWh8Nx58FdSvUFHgkj9FoxvZo+/gbypn 8THhOGgvfTEsH9GmKx9UvjGKhGQklEEGBV6nv4YguvjnpT6SxD8M= X-Sasl-enc: eL4+kOsSYugWZxbE7ifeh3Oat5C7riTfD+ITN30FKHRV 1423093637 Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: The "-" and "--" options (was Re: ${var:1:1:=y}) From: =?windows-1252?Q?Lawrence_Vel=E1zquez?= In-Reply-To: <54D25A02.1000605@eastlink.ca> Date: Wed, 4 Feb 2015 18:47:17 -0500 Cc: zsh-users@zsh.org Content-Transfer-Encoding: 7bit Message-Id: <260A930A-CA77-4BDB-8827-047F742FD3CF@larryv.me> 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> <54D25A02.1000605@eastlink.ca> To: Ray Andrews X-Mailer: Apple Mail (2.2070.6) On Feb 4, 2015, at 12:42 PM, Ray Andrews wrote: > I'm glad I've been disabused of any notion that consistency is something > to be expected or even valued. As others have opined, expecting "consistency" from any echo(1) is a bad bet, and there are reasons why zsh's echo doesn't work the way you want it to. Use printf(1). > 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. It "works" because the argument is actually a hyphen followed by a space. That's why echo doesn't treat it specially. Use this to print a hyphen: % echo - - Or, again, use printf(1) if you're concerned at all about portability. vq