bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Possible bug in Makefile 3.81


From: Bob Proulx
Subject: Re: Possible bug in Makefile 3.81
Date: Tue, 6 Nov 2007 09:34:10 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

address@hidden wrote:
> It is DASH the one causing all the trouble:

But it is pointing out to you an importable part of your makefile.  I
am always thankful when these things are pointed out to me.  Having
/bin/sh linked to a strict shell sounds like an attractive idea to me.

By setting /bin/sh to dash it is very noisily complaining about non-
POSIX /bin/sh features being used.  When you are using [[ you are
using a non-standard shell feature.  That is fine if you are using a
non-standard shell but not if the shell is /bin/sh.  When using
/bin/sh only standard features should be used.

> /bin/dash: [[: not found

If you want to use bash/ksh specific shell syntax then you would need
to specify "SHELL = /bin/ksh" (or whatever) in your Makefile.

SHELL = /bin/ksh
all:
        if [[ -n "string" ]]; then echo "hello"; fi

But personally I recommend sticking to the standard syntax and simply
using the normal and standard test operator.

all:
        if [ -n "string" ]; then echo "hello"; fi

See also the standards documentation.

  http://www.opengroup.org/onlinepubs/009695399/utilities/test.html

Bob




reply via email to

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