[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH] latest ash has broken 'echo' command

Anthony Towns <aj@azure.humbug.org.au> wrote:
> On Thu, Oct 21, 1999 at 11:13:24PM +1000, Herbert Xu wrote:
>> It's not broken.  The Single Unix Specification says that echo must not
>> support any options.

> Then the Single Unix Specification is broken, and we shouldn't follow
> it. Seriously, -e and -n are expected features of echo on GNU/Linux
> systems, no matter what the Single Unix Spec might or might not say.

I've just checked OSF/1 and Solaris, neither of which supports -e.  Both of
them accept -n though.  So this means that you cannot write portable echo
statements that include escape codes unless you specify which kind of shell
(e.g., the GNU shell) which you're going to use.  If you want to use the GNU
shell, say so in your script.

AFAIK, the behaviour specified by SuS is POSIX-complaint, so if your intention
is to write POSIX-compliant shell scripts, you must not use options and
escape codes.

> Dropping them shortly before freeze seems an insane thing to do too,
> fwiw.

It's only ash after all, you don't have to use it.

> Are the BSD people distributing ash without echo -e/-n?

No they are not, after all they invented them :)
Debian GNU/Linux 2.1 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Reply to: