Re: [PATCH 1/2] config.mak.uname: Darwin: define HAVE_GETDELIM for modern OS X releases
- From
Jeff King <peff@peff.net>
- Date
- Jun 2, 2015, 20:01 UTC
- Message-ID
- <20150602200134.GA13382@peff.net>
- In-Reply-To
- <CAPig+cQLSF4=-4b1qOY4ChBj00=trvAO0qFEh0kOjLonJL4MBg@mail.gmail.com>
On Tue, Jun 02, 2015 at 03:57:44PM -0400, Eric Sunshine wrote:
Show 5 quoted lines
> > Oops, I missed the trailing '.' in the regex there, and it probably > > needs double-quotes in case the inner expr fails to match anything. > > Which is messy considering the double quotes already surrounding > $(uname_R). Suggestions?
The shell should do the right thing with nested quotes inside backticks. So just (untested):
$(shell expr "`expr "$(uname_R)" : '\([0-9][0-9]*\.\)'`" '>=' 11),1)
> I suppose the combination of `...` with built-in 'test' and built-in > 'echo' would be the most efficient choice. Do you want it re-rolled?
I can live with it either way. It's all pretty horrible and ugly; the saving grace is that we hopefully never have to touch that line again. ;)
-Peff