[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Openexr-devel] [Patch] Bashism in bootstrap scripts
From: |
Andreas Metzler |
Subject: |
Re: [Openexr-devel] [Patch] Bashism in bootstrap scripts |
Date: |
Thu, 26 Jul 2012 08:39:18 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On 2012-07-26 Piotr Stanczyk <address@hidden> wrote:
> From: address@hidden address@hidden on behalf of Andreas Metzler
> address@hidden
>> Find attached a trivial patch against the four bootstrap scripts,
>> fixing a unnecessary bashism.
> Thanks for the patches. I had a quick look at them and noticed that
> the '==' operator has been replaced by '=' one. Could you provide a
> little more information as to the rationale behind this.
Good morning,
No problem.
[ or test are usually shell-builtins. Bash's builtin' version offers
some enhancements, including the fact that it allows to use "=="
instead of "=" for string comparison. However other POSIX compatible
sh-shells (notably dash) do not. On Ubuntu and Debian /bin/sh is not
Bash, and the command fails:
address@hidden:/tmp/ilmbase$ ./bootstrap
./bootstrap: 4: [: Linux: unexpected operator
bash(1) says about this:
CONDITIONAL EXPRESSIONS
Conditional expressions are used by the [[ compound command and the
test and [ builtin commands to test file attributes and
perform string and arithmetic comparisons.
[...]
string1 == string2
string1 = string2
True if the strings are equal. = should be used with
the test command for POSIX conformance.
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
thanks, cu andreas
--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'