Re: [PATCH] Makefile: abort on shells that do not support ${parameter%word} expansion
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Sep 6, 2011, 20:09 UTC
- Message-ID
- <urATHUDMxTPsK81dgL16m7pg7qY-SQUV-kFZY47c-P0m2twVUC6nD2h-wYpNL6rcveoTNZdxojcfp9X0SeQjMuV97FzxI40RxrDw6pGEAFg@cipher.nrlssc.navy.mil>
- In-Reply-To
- <7v62l58mp2.fsf@alter.siamese.dyndns.org>
On 09/06/2011 03:01 PM, Junio C Hamano wrote:
Show 22 quoted lines
> Brandon Casey <casey@nrlssc.navy.mil> writes:
>
>> From: Brandon Casey <drafnel@gmail.com>
>>
>> Add an entry to the please_set_SHELL_PATH_to_a_more_modern_shell target
>> which tests whether the shell supports ${parameter%word} expansion. I
>> assume this one test is enough to indicate whether the shell supports the
>> entire family of prefix and suffix removal syntax:
>>
>> ${parameter%word}
>> ${parameter%%word}
>> ${parameter#word}
>> ${parameter##word}
>>
>> FreeBSD, for one, has a /bin/sh that, apparently, supports $() notation but
>> not the above prefix/suffix removal notation.
>
> My reading of the later part of the thread you are basing the above is
> somewhat different from your diagnosis. The funny seems to happen only
> when there is a backslash-quoted glob special inside double-quotes
> (e.g. "${parameter%\?*}") and the same shell does not seem to be choking
> on many prefix/suffix expansion used in other test scripts.Ah, I didn't read through closely enough to notice that the above syntax was not also an issue, as was mentioned in the original email.
Sorry for the noise.
-Brandon