Re: Several reasons why debian should not use bash for /bin/sh
Hi,
>>"Gregory" == Gregory S Stark <gsstark@mit.edu> writes:
Gregory> cdulrich@ucdavis.edu (Chris Ulrich) writes:
>> Compatibility: People are tempted to (and in fact do) write scripts that
>> use bash specific extensions when explicitly calling /bin/sh.
Gregory> Most developers seem to react to bug reports about this by
Gregory> changing the script to /bin/bash. While obviously "correct",
Gregory> I think policy should discourage this over using purely
Gregory> Posix sh features when possible.
Gregory> There are two reasons for this, the obvious one being that
Gregory> the script can be run on non-Debian machines.
<ost Linux boxes come with bash. If the y do not, I may not be
willing to support those boxes (fer instance). I think policy should
not be telling authors about ``good'' programming practices.
As far as Debian is concerned, Bash is essential, and
/bin/bash shall always exist. Policy is tno the correct
medium for social change.
Gregory> However the non-obvious one is, imho, even more important:
Gregory> Bash extensions are not protected from future API changes by
Gregory> a standard the way POSIX features are. Bash maintainers can
Gregory> at their whim, introduce api changes to their extensions,
Gregory> possibly breaking any scripts that rely on them.
That should also extend to any share library not protected by
an international standard. This means python, perl, tcl/tk, and X11.
I fail to see any semblance to reality in this reasoning.
Gregory> Also, the Bash-specific features are not necessarily as well
Gregory> specified as POSIX. Depending on such features means that
Gregory> you're never really sure if your script doesn't have some
Gregory> subtle bug. If you depend only on POSIX behaviour then you
Gregory> can report any problems as bash bugs.
Actually, this is incorrect. If the behaviour is not as documented
in Bash documentation, it is a bug. If it is not documented, I don't
use it. If the behaviour of Bash changes, I can and will report it as
a bug, and we peobably shall not have that package in our
ptr-rtelease/stable distributions.
Gregory> A little bit of reality check: Ash and Bash are both
Gregory> reasonably close to POSIX. Bash has some particularly
Gregory> blatant non-POSIXisms whereas ash's non-POSIXisms are more
Gregory> subtle and obscure. I don't know about pdksh, but a hint,
Gregory> any "-posix" flag or the ilk is a very worrisome sign, the
Gregory> standard behaviour has to be the default, anything else is
Gregory> worthless.
You mean bash has blatant non-poxisms when invoked as /bin/sh?
Why is that undesirrable? Be very liberal in what you accept, be ver
strict in what you output. Our /bin/sh should be as liberal as
possible, while confotrming to POSIX. Our scripts are what should be
strict.
Gregory> I would like to see ash made the default shell for slink
Gregory> while it's in unstable. This would help avoid people
Gregory> accidentally using bashisms and would have a lot more
Gregory> developers checking for bugs.
I would strongly object to a restrive shell made the default
/bin/sh in *any* debian distribution. People who want to indulge in
this can do so on their own.
manoj
--
Anything that satisfies its external specifications, no matter how
inefficient it is, is a success; don't argue with it.
Manoj Srivastava <srivasta@acm.org> <http://www.datasync.com/%7Esrivasta/>
Key C7261095 fingerprint = CB D9 F4 12 68 07 E4 05 CC 2D 27 12 1D F5 E8 6E
--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: