Subject: Re: echo -n vs. echo ... \c
To: None <tech-pkg@netbsd.org>
From: Bruce J.A. Nourish <bjan@bjan.freeshell.org>
List: tech-pkg
Date: 04/06/2004 21:52:20
On Tue, Apr 06, 2004 at 04:14:10PM -0400, Todd Vierling wrote:
> Regarding the Linux patch posted about echo, and related things:
> 
> Interix does indeed have an "echo" that doesn't recognize "-n" at all.  In
> fact, the SUSv2/OGBS6 definition of "echo" explicitly *dis*allows the use of
> "-n", and requires use of trailing "\c" instead.  So "\c" is, in effect, the
> Unix(tm) Standard....

"It is not possible to use echo portably across all POSIX systems unless
both -n (as the first argument) and escape sequences are omitted."

 -- http://www.opengroup.org/onlinepubs/007904975/utilities/echo.html

> Perhaps a better idea would be to check the pkgsrc-supported platforms for
> availability of "\c"?

As a practical matter, I think that the traditional BSD "echo -n"
behaviour is more commonly used and supported. Why don't we just
put our echo in bootstrap-pkgsrc and provide it as "nbecho" for
those systems that need it?

Alternatively, tell the people using those platforms to get an 
appropriate echo (builtin or standalone) before using pkgsrc.
-- 
Bruce J.A. Nourish <bjan@bjan.freeshell.org> http://bjan.freeshell.org
SDF Public Access UNIX System - http://sdf.lonestar.org