Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] Makefile: abort on shells that do not support ${parameter%word} expansion

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:51:59

Brandon Casey [off-list ref] writes:
From: Brandon Casey <redacted>

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help