bug-bash
[Top][All Lists]
Advanced

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

Re: Trouble testing for bash


From: Paul Jarc
Subject: Re: Trouble testing for bash
Date: Wed, 24 Oct 2001 01:23:22 -0400
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7

Paul Eggert <eggert@twinsun.com> wrote:
> The fact that Bash acts differently when invoked as "sh" doesn't seem
> to be documented in the Bash reference manual.  Also, it runs contrary
> the GNU coding standards, which say "Please don't make the behavior of
> a utility depend on the name used to invoke it."
> <http://www.gnu.org/prep/standards_16.html#SEC16>
> 
> Perhaps there are historical reasons for this discrepancy, but they
> ought to be documented; if not, Bash should get fixed.

I agree.  If bash tries to be sh, it should do a better job of it.
If bash is just bash, it might be nice for it to print an error and
exit if invoked as /bin/sh, since it breaks sh scripts anyway;
problems will be less likely to go undetected that way.

> There are lots of other troublesome variable names that are reserved
> by some shell or another (e.g. LINENO), and I don't think Autoconf can
> work around them all.  At best we could try to catalog them and have
> Autoconf warn if someone tries to use them.

I've documented some of these (and other sh gotchas) at
<URL:http://multivac.cwru.edu./lintsh/>.


paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]