Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: The "-" and "--" options (was Re: ${var:1:1:=y})



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.

However, there were already incompatible BSD / SYSV echoes even then, so
it was never a full consistency with all possible external command
variants of echo.

pws



Messages sorted by: Reverse Date, Date, Thread, Author