[mcclim-devel] Unportable string comparing syntax in Doc/makeimages.sh

onixie onixie at gmail.com
Sun Apr 24 00:56:45 UTC 2011


Hi,

I think there is an unportable string comparing syntax in Doc/makeimages.sh

Left: portable, Right: unportble by diff
-------------------------------------------------------------
8c8
< if [ "$1" = "-e" ]; then
---
 > if [ "$1" == "-e" ]; then
22c22
<             if [ "$NOCREATE" = "true" ]; then
---
 >             if [ "$NOCREATE" == "true" ]; then
--------------------------------------------------------------

It has expected result in bash,  but reports a syntax error (as below) 
in dash and ash (posix compatible shell).

The syntax error reported:
--------------------------------------------------------------
[: 15: ==: unexpected operator
--------------------------------------------------------------

This is a bug in ubuntu because it defaults to use dash. so I think it 
should be fixed.




More information about the mcclim-devel mailing list