simplified the [[ test ]] to work in older bash shells
simplified the [[ test ]] to work in older bash shells