dash

Matt Zimmerman mdz at ubuntu.com
Fri Sep 15 03:11:14 BST 2006


On Thu, Sep 14, 2006 at 02:06:09PM -0500, Rocco Stanzione wrote:
> ifeq ($(shell [ -a $(KERNEL_DIR)/include/asm ] && echo YES), YES)
> 
> in the Makefile.
> That's a pretty standard shell test, that also fails on the shell:
>
> trappist at monk:~$ dash
> $ [ -a /usr/src/linux/include/asm ] && echo YES
> [: 1: /usr/src/linux/include/asm: unexpected operator
> 
> Other similar examples also fail:
> 
> $ if [ -a /usr/src/linux/include/asm ]; then echo YES; fi
> [: 4: /usr/src/linux/include/asm: unexpected operator
> 
> http://www.opengroup.org/onlinepubs/000095399/utilities/test.html
>
> The above URL shows other examples that should work with a POSIX-compliant 
> shell and do not.  As far as I know, none of the scripts failing to work with 
> dash have failed because the scripts were not POSIX-compliant, but because 
> dash isn't.

Note that the -a test you refer to above is not listed in the standard at
the above URL.

If you have examples of POSIX-compliant shell operations which do not work
in dash, then those are bugs and should be filed as such.  Your example
above doesn't fall into that category, though.

iptables should be using -e, which is the POSIX form.

-- 
 - mdz



More information about the ubuntu-devel mailing list