Subject: Re: discrepency beteen /bin/echo and builtin echo of /bin/sh
To: <>
From: David Laight <>
List: current-users
Date: 06/08/2002 20:05:48
On Sat, Jun 08, 2002 at 04:32:59PM +0100, Ben Harris wrote:
> In article <> you write:
> >I was perusing the source for the builtin echo of 'sh'
> >(src/bin/sh/bltin/echo.c) and noticed code that
> >it looks for a '-e' paramter.
> >This is neither documented nor well written, nor does /bin/echo
> >behave the same way.
> This is on my list of things to fix once I've got some spare time. 
> Supporting any options besides -n isn't permitted by POSIX (ignore the fact
> that POSIX-2001 bans -n as well -- that'll be fixed in TC1), so I plan to
> just have sh incorporate the code from /bin/echo.

The code will rip out easily enough, it is (almost) under a
conditional compilation already.

It might? be worth including print (aka ksh), you don't always want
the complexity of printf (esp. since is isn't a builtin).

The man page ought to list the builtins, there are some subtle
differences.  eg what happens when a redirect fails (not checked
that on netbsd - you need a device driver that rejects opens).


David Laight: