Best way to check in bash if Command Line Tools are installed?
if type xcode-select &gt;&amp;- &amp;&amp; xpath=$( xcode-select --print-path ) &amp;&amp;
   test -d "${xpath}" &amp;&amp; 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.