Created
December 29, 2008 01:30
-
-
Save jcf/41124 to your computer and use it in GitHub Desktop.
Prints a list of used UIDs via dscl
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 | |
users = %x(dscl . -list /Users).split("\n") | |
uids = [] | |
users.each do |user| | |
uids += [%x(dscl . -read /Users/#{user} uid).split[-1].to_i] | |
end | |
puts uids.sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment