Created
December 29, 2008 02:12
-
-
Save jcf/41131 to your computer and use it in GitHub Desktop.
We list UIDs so why not PrimaryGroupIDs in an equally slow fashion?!
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
#!/usr/bin/env ruby -wKU | |
groups = %x(dscl . -list /Groups).split("\n") | |
gids = [] | |
groups.each do |group| | |
gids += [%x(dscl . -read /Groups/#{group} PrimaryGroupID).split[-1].to_i] | |
end | |
puts gids.sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment