Skip to content

Instantly share code, notes, and snippets.

@robie1373
Created July 31, 2012 18:24
Show Gist options
  • Save robie1373/3219221 to your computer and use it in GitHub Desktop.
Save robie1373/3219221 to your computer and use it in GitHub Desktop.
Get all com.apple.blah defaults
#!/usr/bin/env ruby
(`defaults domains`).split(', ').each do |thing|
# p thing uncomment to watch the domains
if thing.match /com\.apple.*/
default = "\n\n#{thing}\n"
default << `defaults read #{thing}`.to_s
p default
File.open('defaults.txt', 'a+') { |f| f.write(default) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment