Last active
September 22, 2017 13:46
-
-
Save Pranit-Harekar/ab926532943b63c8189a91d704deb5ff to your computer and use it in GitHub Desktop.
Remote shell script to automatically install XCode CLI tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress | |
| PROD=$(softwareupdate -l | grep "\*.*Command Line" | head -n 1 | awk -F"*" '{print $2}' | sed -e 's/^ *//' | tr -d '\n') | |
| softwareupdate -i "$PROD" --verbose | |
| rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment