Re: [PATCH] latest ash has broken 'echo' command
On Mon, Oct 25, 1999 at 12:00:32AM +1000, Herbert Xu wrote:
> > > If you mean they use ash as /bin/sh and rely on features that are not
> > > part of POSIX, they are on their own.
On Sun, Oct 24, 1999 at 11:50:19AM -0400, Raul Miller wrote:
> > echo -n is an optional part of POSIX. The POSIX committee clearly
> > intends that systems continue to support echo -n or backslash escape
> > codes to support their legacy software.
On Mon, Oct 25, 1999 at 10:09:16AM +1000, Herbert Xu wrote:
> If they did they would've made it mandatory.
No. Mandantory behavior is for portable software. Optional behavior
is for legacy software.
> > > > 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.
> >
> > Please provide a quote from the standard which supports this point of
> > view.
>
> Both support -e.
Ok.
> > > POSIX does not allow you to exit with an error.
> >
> > <quote>
> > string A string to be written to standard output. If the first
> > operand is "-n" or if any of the operands contain a
> > backslash (\) character, the results are implementation
> > defined.
> > </quote>
> >
> > Ok, it's true that I've not verified that "exit with an error" fits within
> > the technical POSIX definition for "implementation defined". I've lost
> > the url for the posix draft. If you know of a reference which shows that
> > exit with an error is an inappropriate "implementation defined" result
> > then I'll accept that this isn't the right approach.
>
> True, exiting for -n is probably within the parameters. But remember we're
> trying to catch -e as well.
(a) That's a much smaller problem.
(b) -e implies the existence of backslash escape codes.
Unless the posix standard has different language than the above quoted
text I think that the "strict sh" shell would do fine exiting with an
error and an error message when backslash escape codes are present.
--
Raul
Reply to: