[PATCH modular 03/13] build.sh: allow user to specify an alternate bin directory
Alan Coopersmith
alan.coopersmith at oracle.com
Wed Dec 29 19:25:53 PST 2010
On 12/29/10 07:21 PM, Trevor Woerner wrote:
> On Wed, Dec 29, 2010 at 9:58 PM, Gaetan Nadon <memsize at videotron.ca> wrote:
>> isn't it ${BINDIR:-$EPREFIX/bin} ?
>
> These types of shell tests check whether or not the first value is
> unset or null, "omitting the colon results in a test only for a
> parameter that is unset". So what I'm saying is you can set BINDIR to
> "" and the script will still use that value (I'll let you choose to
> have a blank BINDIR). Maybe that doesn't make sense?
>
> CAVEAT: we should probably check with the Solaris guys to verify this
> works in their shell? But I'm assuming it will because the other
> variables are using something similar.
Yes, from the Solaris 10 man page for the historic Bourne shell (which
you should be able to see on docs.sun.com):
${parameter:-word} If parameter is set and is non-null,
substitute its value; otherwise sub-
stitute word.
${parameter:=word} If parameter is not set or is null
set it to word; the value of the
parameter is substituted. Positional
parameters may not be assigned in
this way.
${parameter:?word} If parameter is set and is non-null,
substitute its value; otherwise,
print word and exit from the shell.
If word is omitted, the message
"parameter null or not set" is
printed.
${parameter:+word} If parameter is set and is non-null,
substitute word; otherwise substi-
tute nothing.
In the above, word is not evaluated unless it is to be used
as the substituted string, so that, in the following exam-
ple, pwd is executed only if d is not set or is null:
echo ${d:-`pwd`}
If the colon (:) is omitted from the above expressions, the
shell only checks whether parameter is set or not.
--
-Alan Coopersmith- alan.coopersmith at oracle.com
Oracle Solaris Platform Engineering: X Window System
More information about the xorg-devel
mailing list