Created
March 5, 2011 17:52
-
-
Save rockpapergoat/856545 to your computer and use it in GitHub Desktop.
capture users and uids, filtering for > 500 uids
This file contains 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 | |
# capture users and uids, filtering for > 500 uids | |
# want to emulate dscl . -list /users UniqueID | awk '$2 > 500 { print $1 }' | |
def get_nonsys_users | |
users = `dscl . -list /users UniqueID`.split("\n").collect! {|u| u.sub!(/\ +/, ",").split(",").to_a}.select {|u| u[1].to_i > 500} | |
end | |
p get_nonsys_users |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment