Subject: Re: discrepency beteen /bin/echo and builtin echo of /bin/sh
From: David Laight <email@example.com>
Date: 06/11/2002 00:11:10
On Mon, Jun 10, 2002 at 05:01:25PM -0500, Eric Gillespie wrote:
> Ben Harris <firstname.lastname@example.org> writes:
> > > (ignore the fact that POSIX-2001 bans -n as well -- that'll be fixed in TC1
> > )
> > That's still true (XCU/TC1/D1/7, if you want to look it up).
> Well there you go; the standard changes again. That's why this
> entire discussion is purely academic from my point of view; you
> have to use printf if you're doing anything other than 'echo "foo"'
> or 'echo "foo $bar"'. echo is completely unreliable.
output of echo "foo $bar" depends on what bar contains...
FWIW I got printf running as a builting to /bin/sh this afternoon.
Not too hard - was 'temporarily removed' once according to SCCS!
(fixed a buffer overflow problem in printf at the same time,
printf "%1111111111111111111111111111111111111111111111111111111111111111111111111111111111d\n" 42
generates a core dump.)
Might submit a PR tomorrow (today) if anyone might consider applying it.
David Laight: email@example.com