Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 1.02 KB

vars-apple-software.md

File metadata and controls

43 lines (34 loc) · 1.02 KB

macOS & Mac Software Update Information

OS VERSION
sw_vers -productVersion
OS VERSION - MAJOR
sw_vers -productVersion | cut -d. -f1
OS VERSION - MINOR
sw_vers -productVersion | cut -d. -f2-
BUILD NUMBER
sw_vers -buildVersion
FRONTMOST APP
osascript -e 'tell app "System Events" to return name of first application process whose frontmost is true'
LIST ALL 32-BIT APPLICATIONS
while IFS= read -r app; do file "$app"/Contents/MacOS/* | awk -F: '!/for/&&/i386/&&!/x86_64/{gsub(/\ /,"\\ ");print $1}'; done < <(find -x / -path /System -prune -o -name "*.app" 2> /dev/null)
SOFTWARE UPDATE SERVER
defaults read /Library/Preferences/com.apple.SoftwareUpdate.plist CatalogURL 2> /dev/null

# note: key does not exist if set to default, thus 2> /dev/null will prevent using stderr
AUTOMATIC UPDATES ENABLED
defaults read /Library/Preferences/com.apple.SoftwareUpdate.plist AutomaticCheckEnabled