Subject: Re: discrepency beteen /bin/echo and builtin echo of /bin/sh
To: David Laight <david@l8s.co.uk>
From: Rick Kelly <rmk@toad.rmkhome.com>
List: current-users
Date: 06/10/2002 19:59:56
David Laight said:

>On Mon, Jun 10, 2002 at 05:01:25PM -0500, Eric Gillespie wrote:

>> 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...

It seems like most shells out there accept "echo -n".

SunOS 4.x sh and csh
ksh88 and ksh93 - most platforms except Solaris - NetBSD/i386 ksh93 binary
accepts "echo -n"

SCO Openserver and UNIXWare accept echo -n.

SunOS 4.1.x accept echo -n.

>(fixed a buffer overflow problem in printf at the same time,
>printf "%1111111111111111111111111111111111111111111111111111111111111111111111111111111111d\n" 42
>generates a core dump.)

That's cool that it is fixed.

-- 
Rick Kelly  rmk@rmkhome.com  www.rmkhome.com