ltib
[Top][All Lists]
Advanced

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

Re: [Ltib] base_libs bash/dash if test


From: Stuart Hughes
Subject: Re: [Ltib] base_libs bash/dash if test
Date: Thu, 13 Sep 2012 08:51:47 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.28) Gecko/20120313 Lightning/1.0b2 Thunderbird/3.1.20

Hi Mike,

Oh the joys of dash, looks like you found one more thing that needs a compatibility change.

I think if [ $? -eq 1 ]; then .. is better as it should work on dash because [ is actually a link to the external test command. I don't have dash to test on though.

Regards, Stuart

On 12/09/12 18:49, Mike Goins wrote:
I was having a problem with base_libs and possibly found a problem
with this test in base_libs.spec:


${TOOLCHAIN_PREFIX}gcc -v 2>&1 | grep -q "prefix=/usr"
if (( $? ))
then


so I wrote a test script:


$ cat tst
#!/bin/sh
if (( 1 )); then echo OK; fi

$ bash -x ./tst
+ ((  1  ))
+ echo OK
OK

$ dash -x ./tst
+ 1
./tst: 3: ./tst: 1: not found


Assuming I am right as I am not as familiar with dash as bash, how about?

if [ $? -eq 1 ]; then

Thanks





reply via email to

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