Subject: Re: discrepency beteen /bin/echo and builtin echo of /bin/sh
To: NetBSD-current Discussion List <firstname.lastname@example.org>
From: Eric Gillespie <email@example.com>
Date: 06/10/2002 11:56:03
Robert Elz <kre@munnari.OZ.AU> writes:
> But echo is not supposed to be print, it is supposed to be echo.
> With echo interpreting characters anywhere in its args, there
> is no sane way to do
> echo $foo
> unless you know what is in foo to start with, in which case there
> isn't a lot of point printing it...
> It sounds as if posix is doing something right, though arguments can be
> made for even getting rid of -n and simply having echo echo its args to
> stdout, with no additions, subtractions, ...
And as a matter of fact they have. I'm surprised no one has brought
up the new unified POSIX/SUSv3, which forbids all options to echo(1):
| echo [string ...]
| The echo utility writes its arguments to standard output, followed
| by a <newline>. If there are no arguments, only the <newline> is
| The echo utility shall not recognize the "--" argument in the manner
| specified by Guideline 10 of the Base Definitions volume of IEEE
| Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines; "--"
| shall be recognized as a string operand.
| Implementations shall not support any options.
Eric Gillespie <*> firstname.lastname@example.org
Conformity is a sin.