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

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



On Sun, Oct 24, 1999 at 07:35:38AM -0400, Raul Miller wrote:
> 
> Once again:
> 
> We have a large user base, some of whom have come to rely on the current
> behavior of ash.

If you mean they use ash as /bin/sh and rely on features that are not part of
POSIX, they are on their own.  If you mean they are writing #!/bin/ash
scripts, then I must say that they are very strange indeed.

> I understand that the upstream source has a different implementation.
> However, our implementation of ash has been changed and that has set a
> new standard -- one which we do have some obligation to support.

Not unless they are writing #!/bin/ash.

> There's nothing wrong with the debian fork of ash, from the POSIX point
> of view.  There's nothing wrong with the upstream form of ash, from the
> POSIX point of view.  They're just different.

Actually, neither are POSIX compliant at the moment with respect to echo.

> If it makes sense for debian scripts to be fixed, it doesn't mean that
> the behavior of ash must be changed.  There are other ways to achieve
> that end.

True, but remember that no one is supposed to write #!/bin/ash scripts, so
once we've sorted out (assuming that we actually want to) our own scripts,
there is nothing stopping us from changing the behaviour of ash.

> If your goal is strict compliance with the POSIX draft then the newly
> introduced ash should exit with an error, and an error message if there
> are any backslash (\) characters in the argument (and that error message
> should be locale specific).  And there are probably similar changes that
> should be made in other aspects of that program.

POSIX does not allow you to exit with an error.

Also, POSIX actually supports escape codes by default.  So escape codes can
always be used.  I know that I've indicated to the contrary before, but now
that I've got the draft (which AFAIK has been passed by IEEE and ISO) from
Sven, it's very clear that escape codes are in, and -n is implementation
defined.

What I will do for ash after potato is released is to syslog some debugging
messages when a possible -e/-n is detected to aid the discovery of
non-compliant scripts.

> Of course, that's subject to change: we're not talking about conformance
> to a POSIX standard here.  We're talking about conformance to a POSIX
> draft.  So presumably your "ash-strict" would be changed as new drafts are
> released [and to strictly enforce other aspects of strict POSIX behavior,
> beyond echo].

The most recently approved POSIX standard certainly forbids -e and defines
-n as implmentation defined.  The POSIX draft that Andrew Josey was talking
about actually contains the same specification of echo as the SUS.

So it is very unlikely to change at all.
-- 
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: