Re: portability of ${foo:+bar}

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

 



Ralf Wildenhues <Ralf.Wildenhues@xxxxxx> writes:

> Quoting autoconf.info:
>
> | `${VAR:-VALUE}'
> |      Old BSD shells, including the Ultrix `sh', don't accept the colon
> |      for any shell substitution, and complain and die.
>
> Can I assume that any shell on a system, which has shared libraries,
> understands `${foo:+bar}' and `${foo:-bar}' correctly, even if bar
> happens to be `:'?

Ultrix had shared libraries, I think; so the answer would probably be
'no' if you want to port to old Ultrix hosts.  However these old hosts
are becoming pretty rare these days; I'm not sure they're worth
worrying about.

> Rationale: it makes avoiding a stray colon in colon-separated variables
> sooo much easier,

In some cases ${foo+bar} and ${foo-bar} suffice; that's portable.


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux