if type xcode-select >&- && xpath=$( xcode-select --print-path ) && test -d ${xpath} && test -x ${xpath} ; then #... is correctly installed else #... isn't correctly installed fi Strangely, the `--print-path` isn't documented in old Xcode versions but is working as `-print-path`. On the other hand, the `-p` option doesn't have this compatibility.