Skip to content

Instantly share code, notes, and snippets.

@rockpapergoat
Created March 5, 2011 18:23
Show Gist options
  • Save rockpapergoat/856570 to your computer and use it in GitHub Desktop.
Save rockpapergoat/856570 to your computer and use it in GitHub Desktop.
just filter users, not uids
#!/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