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

Re: ash/echo/POSIX/SUS



On Sat, Oct 30, 1999 at 06:31:28AM -0400, Raul Miller wrote:
> On Sat, Oct 30, 1999 at 12:47:22PM +1000, Herbert Xu wrote:
> > POSIX allows the shell to implement -n. It certainly does not allow a
> > compliant script to use it.
> 
> Debian policy doesn't require that scripts be posix compliant but does
> require that /bin/sh be posix compliant.

no, you've got that the wrong way around.

there are never any complaints that bash supports bashisms, but there
are regular complaints that some #!/bin/sh or other makes use of them.

similarly, it's not a bug for a #!/bin/sh shell to support compatible
extensions (i.e. those that don't change the behaviour of required
builtins), but it IS definitely a bug for #!/bin/sh scripts to use those
extensions.

if scripts use non-posix features, then they must use the appropriate
#! line.


note that "echo -n" is not a compatible extension because it changes the
behaviour of echo (which is basically defined as "ignore all -options,
just print every arg to stdout").

if a script relies on "echo -n", then it may not use #!/bin/sh, it MUST
use #!/bin/ash or #!/bin/bash or whatever.

of course, using "/bin/echo -n" is perfectly OK.

craig

--
craig sanders


Reply to: