Subject: Re: echo -n vs. echo ... \c
To: None <tech-pkg@netbsd.org>
From: Todd Vierling <tv@duh.org>
List: tech-pkg
Date: 04/07/2004 09:45:26
On Tue, 6 Apr 2004, Bruce J.A. Nourish wrote:

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

Restricting the subset of OS's to those either modernly supported, or
unsupported by its vendor but supported by pkgsrc, I'd be willing to put a
wager on that "\c" is more widely supported.  8-)

In any case:

On Wed, 7 Apr 2004, Julio M. Merino Vidal wrote:

: Why not use printf(1)?

I think this is probably a good idea.  For a one-line message,

    printf %s "message"

is semantically equivalent to

    echo "message\c"   [standard]
    echo -n "message"  [traditional BSD]

This looks like a good job for a defs.* variable.  I'll look into that.

-- 
-- Todd Vierling <tv@duh.org> <tv@pobox.com>