"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