Re: [HACKERS] pgsql: Use strip -x on OS/X-darwinbecause non-"-x" causes link - Mailing list pgsql-committers

From Gregory Stark
Subject Re: [HACKERS] pgsql: Use strip -x on OS/X-darwinbecause non-"-x" causes link
Date
Msg-id 87oddy3rde.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: [HACKERS] pgsql: Use strip -x on OS/X-darwin because non-"-x" causes link  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-committers
"Alvaro Herrera" <alvherre@alvh.no-ip.org> writes:

> Hmm, this doesn't seem to work for me:
>
> $ if test expr "`uname -a`" : 'Darwin' -ne 0
>>   then  stripprog="${STRIPPROG-strip -x}"
>>   else  stripprog="${STRIPPROG-strip}"
>>   fi
> -bash: test: too many arguments

No, "test" and "expr" are separate programs.

The above would be

if test "$(expr "$(uname -a)" : Darwin)" -ne 0 ; then
...

Except the "test" invocation is entirely redundant, expr is already intended
to be used as the program for an if condition. You can just do:

if expr "`uname -a`" : Darwin >/dev/null ; then
...


--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's On-Demand Production Tuning

pgsql-committers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] pgsql: Use strip -x on OS/X-darwin because non-"-x" causes link
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Replace the now-incompatible-with-core contrib/tsearch2 module