hanging problem reproduced in Java
reproduced script hanging relying just on shell