[Olsr-dev] should bash be required?

John Hay (spam-protected)
Fri Sep 7 12:42:09 CEST 2007


On Fri, Sep 07, 2007 at 10:52:03AM +0200, Bernd Petrovitsch wrote:
> On Fri, 2007-09-07 at 08:16 +0200, John Hay wrote:
> > Hi,
> > 
> > Would it be ok to try and get rid of bashisms? Not all unix machines
> 
> IMHO of course. The only reason I used "bash" with all features is that
> I didn't
> found an easy way to test with a true "posix shell" (does any know how
> to make
> "bash" POSIX-pure? The last time I tried, it accepted also non-POSIX
> things).
> So I didn't even pretend to do it:-)
> 
> > have bash installed. Here is my try at it. It was tested on FreeBSD
> > only, but I have tried to stay within the posix specs, so it should
> > work everywhere... I think. :-)
> 
> If not someone will or should speak up (and send a patch;-).
> 
> > --- Makefile.inc.orig	2007-08-02 14:31:38.000000000 +0200
> > +++ Makefile.inc	2007-08-15 11:49:51.000000000 +0200
> > @@ -1,5 +1,5 @@
> >  # programs
> > -CCACHE ?=       $(shell bash -c "type -path ccache")
> > +CCACHE ?=       $(shell sh -c "which ccache")
> +CCACHE ?=       $(shell which ccache)
> should be enough (and saves a fork(2) and exec(2)). Or is "which" a
> sh-builtin
> (like type in the "bash")?

It is a builtin too. There is an external /usr/bin/which also, so I
think your way is ok.

John
-- 
John Hay -- (spam-protected) / (spam-protected)




More information about the Olsr-dev mailing list