Subject: Re: discrepency beteen /bin/echo and builtin echo of /bin/sh
To: Eric Gillespie <epg@pretzelnet.org>
From: Robert Elz <kre@munnari.OZ.AU>
List: current-users
Date: 06/12/2002 21:02:05
Date: Mon, 10 Jun 2002 11:56:03 -0500
From: Eric Gillespie <epg@pretzelnet.org>
Message-ID: <20020610165603.7026FA2C8@romulus.pretzelnet.org>
| 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):
Leaving aside the stuff about interpreting \ nonsense which appears
to remain in those drafts (options aren't an issue, one can always have
-- to end the options unambiguously, though it wouldn't be backward
compat, but \ escapes in echo are simply horrid).
But when I said "nothing added" I meant specifically not ...
| | The echo utility writes its arguments to standard output, followed
| | by a <newline>.
That is, the <newline> shouldn't be there either (if -n were to be deleted).
If one wants a newline appended then
nl='
'
echo string"$nl"
is pretty easy to manage. Of course, there's simply too much history
with echo now to ever truly make it rational.
kre