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

Re: A note on modern git plus ancient meld ("wrong number of arguments")

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:53:02

Hi,

Sebastian Schuberth wrote:
On Fri, Feb 10, 2012 at 09:23, Jonathan Nieder [off-list ref] wrote:
quoted
+       meld_version=${meld_version#GNOME }
+       meld_version=${meld_version#* }
Hmm, I might be mistaken, but aren't these string operations
Bash-only? And AFAIK Git is striving for standard sh compatibility ...
They are widely supported in POSIX-style shells.  See [1] and
Documentation/CodingGuidelines:

 - We use POSIX compliant parameter substitutions and avoid bashisms;
   namely:

   - We use ${parameter-word} and its [-=?+] siblings, and their
     colon'ed "unset or null" form.

   - We use ${parameter#word} and its [#%] siblings, and their
     doubled "longest matching" form.

A good way to catch these things is to try with dash or posh, which
are a little less full-featured than bash and ksh.

Thanks for looking it over.
Jonathan

[1] http://pubs.opengroup.org/onlinepubs/9699919799/
Search for "sh -".
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help