You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

macOS_Catalina_acid_test.sh 495B

123456789101112131415161718192021
  1. #!/bin/bash
  2. pkgs=(
  3. "com.apple.pkg.DeveloperToolsCLILeo" # standalone
  4. "com.apple.pkg.DeveloperToolsCLI" # from XCode
  5. "com.apple.pkg.CLTools_Executables" # Mavericks
  6. )
  7. for pkg in "${pkgs[@]}"; do
  8. output=$(/usr/sbin/pkgutil --pkg-info "$pkg" 2>/dev/null)
  9. if [ "$output" ]; then
  10. version=$(echo "$output" | grep 'version' | cut -d' ' -f2)
  11. break
  12. fi
  13. done
  14. if [ "$version" ]; then
  15. echo "Command Line Tools version: $version"
  16. else
  17. echo >&2 'Command Line Tools not found'
  18. fi