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

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



Marek Habersack wrote:
> 
> * Herbert Xu said:
> > On Thu, Oct 21, 1999 at 09:39:00PM +0200, Sven Rudolph wrote:
> > >
> > > Did we decide to follow Single Unix Specification. I thought we were
> > > on POSIX, and my draft allows -n (implementation defined).
> >
> > If it's implementation defined that means echo is also allowed to not support
> > any options at all.  So if you were going to write a script that should work
> > on all POSIX compliant shells, you must not use options and escape codes.
> That's about a *script*, we're talking about the *shell* which is supposed
> to provide every capability in the standard. This means the echo command
> should support both arguments. Whether the script programmer uses them or
> not - it's his problem, shell should support it.

No, this is not correct. A shell can choose only to implement the
functionality that must
be there according to POSIX and hence be POSIX compliant. If all
implementations had to be fat, there would be no point inn declaring
some features to be optional.

Either you choose to be unportable and make use of optional features, or
you
aim at compatibility and don't use optional features without checking if
they exist.
The same goes for many other things (for example use of PATH_MAX vs
sysconf etc).

Marcus


Reply to: