Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: The "-" and "--" options (was Re: ${var:1:1:=y})
- X-seq: zsh-workers 34461
- From: Christian Neukirchen <chneukirchen@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: The "-" and "--" options (was Re: ${var:1:1:=y})
- Date: Wed, 04 Feb 2015 20:19:39 +0100
- In-reply-to: <20150204190248.3571f2e2__17447.6025546484$1423076706$gmane$org@pwslap01u.europe.root.pri> (Peter Stephenson's message of "Wed, 04 Feb 2015 19:02:48 +0000")
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <54D155C8.4080600@eastlink.ca> <412544FB-49A2-43AA-BC76-DC1AF1AA71BE@larryv.me> <54D16A4C.9010609@eastlink.ca> <B2986EC3-5BF2-4DBC-ABB9-7B6935FE2F91@larryv.me> <150203192508.ZM2159@torch.brasslantern.com> <54D195B2.4070205@gmx.com> <150204091014.ZM3216@torch.brasslantern.com> <20150204190248.3571f2e2__17447.6025546484$1423076706$gmane$org@pwslap01u.europe.root.pri>
Peter Stephenson <p.stephenson@xxxxxxxxxxx> writes:
> On Wed, 4 Feb 2015 09:10:14 -0800
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>> Also "echo" does NOT accept "--" in this way, it ONLY acceps a solitary
>> "-". I forget why that is.
>
> I think the decision for echo (some years ago) was that it would be
> better to make it consistent with versions of /bin/echo rather than with
> the normal internal interface, since shell scripts were written to the
> external echo interface even if the shell had the builtin.
>
> It seems this argument still works on Linux at least:
>
> % /bin/echo -- foo
> -- foo
>
> so I think we were (probably) right and this is the best consistency
> we're going to get.
% echo -
% /bin/echo -
-
% /bin/echo --version
echo (GNU coreutils) 8.23
The only winning move is to use printf(1).
--
Christian Neukirchen <chneukirchen@xxxxxxxxx> http://chneukirchen.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author