From: Junio C Hamano Date: Thu, 21 Apr 2022 19:11:58 GMT Subject: Re: [PATCH v2] CI: select CC based on CC_PACKAGE (again) Message-ID: In-Reply-To: Carlo Arenas writes: >> - CC="${CC:-gcc}" >> + CC="${CC_PACKAGE:-${CC:-gcc}}" > > minor nitpick, but most likely still relevant considering your other > "bashism" fixes. > the POSIX syntax doesn't use ":" (documented in CodingGuidelines) You are reading the guideline wrong, I am afraid. This is not a substring substitution, ${foo:0:3} picking three characters from the beginning of foo. It is "If CC_PACKAGE is UNSET OR SET TO EMPTY, then use the fallback value that is ${CC:-gcc}", which is a bog standard bourne shell that predates POSIX. The colon before "-" is what adds "OR SET TO EMPTY" part; without the colon, i.e. "${CC_PACKAGE-${CC-gcc}}", then you get the same without "OR SET TO EMPTY" part. And we do use that form.