> what does the printf $? do?

@chrisopedia `printf $?` prints the exit code of the last executed command (in this case `xcode-select -p &> /dev/null`).