use more compatible conditionals in bash script