Bug#88045: Policy is contradictory (I think)
Package: debian-policy
Version: 3.1.1.1
Section 4.4 says:
> The standard shell interpreter ``/bin/sh'' may be a symbolic link to
> any POSIX compatible shell.
Section 3.3.6 gives examples for init.d scripts using ``echo -n''.
Now POSIX leaves the behaviour of ``echo'' with arguments starting
with `-' undefined (in order to accomodate both SYSV and BSD versions
of echo). In addition, POSIX allows echo to be a shell builtin.
Therefore, the script given in 3.3.6 will not work if echo is a shell
builtin with SYSV semantics. This is not a purely theoretical issue:
ksh93 behaves just like that, and can therefore not be used as /bin/sh
on a Debian system.
Solutions include:
1. making all /bin/sh scripts use printf instead of echo -n (this is
the portable way; POSIX deprecates the use of echo);
2. making all /bin/sh scripts use /bin/echo instead of echo (not
portable to other POSIX systems).
3. making all /bin/sh scripts use GNU shelltool instead of echo (yuck).
4. updating section 4.4 in policy with a caveat about echo.
Regards,
Juliusz Chroboczek
Reply to: