RFR: 8011350 : hgforesth.sh fails if sh is not bash

Mike Duigou mike.duigou at oracle.com
Wed Apr 3 03:03:28 UTC 2013

Hello all;

Further testing on JDK-8011342 revealed that hgforest.sh can fail if the sh shell is not bash. The problem appears to be due to mixing of -o -a and ! in [] test expressions.

I have prepared a webrev here:


This converts all of the potentially problematic [ expr -o expr ] [ expr -a expr ] and [ expr -{o|a} ! expr ] to use "test". My conversions are based on the advice of the autotools chapter on "Writing portable Bourne Shell" (http://sourceware.org/autobook/autobook/autobook_208.html#SEC208) for avoiding potential problems. 

The other option is just to require bash which is already required by the new build process.


More information about the build-dev mailing list