Created
March 5, 2011 18:23
-
-
Save rockpapergoat/856570 to your computer and use it in GitHub Desktop.
just filter users, not 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 | |
def non_sys_users | |
users = `dscl . -list /users`.split("\n").reject { |user| user.match(/^_/) or ["n8","root","puppet","daemon", "Guest", "nobody"].include?(user) } | |
end | |
p non_sys_users |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment