Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- require 'yaml'
- class SystemProfiler
- class SPHardware
- def uuid
- data.dig 'Hardware', 'Hardware Overview', 'Hardware UUID'
- end
- def data
- @command_output ||= YAML.load(`/usr/sbin/system_profiler SPHardwareDataType`)
- end
- end
- end
- puts SystemProfiler::SPHardware.new.uuid
Add Comment
Please, Sign In to add comment