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

Re: Several reasons why debian should not use bash for /bin/sh



Chris Reed wrote:
> On Wed, 29 Jul 1998 15:24:54 -0700 , Chris Ulrich wrote: 
> 
> > [Assuming /bin/sh == bash problems]
> 
> >Any script that needs an extension that is not in traditional Bourne shell
> >but which calls /bin/sh is buggy and should be fixed.
> 
> Agreed.  Is there an automated way of checking whether a script uses any 
> bash (or even ksh) extensions when it starts with #!/bin/sh ?  If so, I 
> suggest it is added to lintian, which should suggest it is re-written to 
> use /bin/bash.

I think debstd has a script to check for bashisms, but I don't know
how thorough it is.

I started on a shellscript tokenizer a long time ago, but didn't get
all that far.  You can find a skeleton of it in the lintian source
package somewhere.  I think such a tokenizer would be a good first
step in checking for bash extensions, and would be much more accurate
than applying simple heuristics like grepping for "function".

> (Indeed, looking at /usr/share/lintian/checks/scripts, it's suggested in 
> the comment at the top of the file.)

I will not have time to write such a check myself.

A much more direct way of finding these incompatibilities might be
to put a non-bash /bin/sh in slink :-)

Richard Braakman


--  
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: