From: Jonathan Nieder Date: Fri, 10 Feb 2012 17:59:15 GMT Subject: Re: A note on modern git plus ancient meld ("wrong number of arguments") Message-ID: <20120210175915.GB19216@burratino> In-Reply-To: Hi, Sebastian Schuberth wrote: > On Fri, Feb 10, 2012 at 09:23, Jonathan Nieder wrote: >> +       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 -".