On 4/3/18 1:15 PM, PRussell wrote:
> Chet, is the output on opensuse running bash 4.4.19, correct?
> 
> The specific output:
> 
> ./t.sh: line 9: ���#V: var1 ==  : syntax error: operand expected (error
> token is "==  ")
> 
> archlinux has the same version of bash and I got the same results as on
> opensuse.
> 
> Below are the details of running ./t.sh &>t.log on multiple versions of bash.

I don't see the same type of memory corruption.  I get:

chet-mail(1)$ lsb_release -d
Description:    Red Hat Enterprise Linux Server release 6.9 (Santiago)
chet-mail(1)$ cat ./x18
( set -x;var=0;var1=var; (( var1 == $var2 )) && echo yes || echo no )
chet-mail(1)$ ./bash -c 'echo $BASH_VERSION'
4.4.19(4)-release
chet-mail(1)$ ./bash ./x18
+ var=0
+ var1=var
+ ((  var1 ==   ))
./x18: line 1: ((: var1 ==  : syntax error: operand expected (error token
is "==  ")
+ echo no
no

But otherwise the results are correct.

If you'd like, take a look at running your version under valgrind or a
similar tool to see if bash is touching freed memory. (I don't happen to
see that running on RHEL, but your results may vary with a distribution-
compiled version.)

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to