[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash-5.1.8 does not compile anymore on HP-UX due to invalid shell sy

From: Greg Wooledge
Subject: Re: bash-5.1.8 does not compile anymore on HP-UX due to invalid shell syntax
Date: Tue, 17 Aug 2021 10:39:44 -0400

On Tue, Aug 17, 2021 at 07:30:45AM -0700, L A Walsh wrote:
> The pairs are about 4 related operations.  If you let P = the oPerator
> then the odd lines are about ':P' and the even lines are about 'P' (no
> colon).
> The Pairs from 1-4 are about the operators: '-', '=', '?', '+'
> Pair 4 shows effects of ':+' and '+'.
> Isn't that what you are talking about?
> Yeah -- w/o the ':' looks a bit 'off', but it has a separate meaning
> and has been around for a long time.
> (I first encountered it when porting 1980's era scripts)

The form without the colon (':') is the original form, and comes from
the Bourne shell.  If you read sufficiently old literature, you'll see
*only* those forms mentioned.

The form with the colon was added by the first Korn shell, and became
widely adopted by other shells.  Eventually it became standardized

So yes, all 8 forms are standardized by POSIX.

I'm still wondering what issue the OP is actually seeing.  If they claim
that changing ${GCC+-stuff} to ${GCC:+-stuff} in some file fixes things,
and if they also claim that *something* is setting the GCC variable to
the empty string rather than unsetting it, then perhaps it's not a
syntactic error at all, but rather a logical error.

Either the thing that's setting GCC to the empty string ought to be
changed to unset GCC, or else the ${GCC+-stuff} check ought to be changed
to ${GCC:+-stuff} (at the risk of breaking Bourne shell compatibility,
if we care about that).

But this is speculative until they tell us what the actual problem is.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]