Removed a bash-ism: replaced [[ conditional ]] with [ conditional ]